Skip to content

Latest commit

 

History

History

material-preference

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Material Preference

Maven Central

This library implements Material 3 Preference theme by extending AndroidX preference theme.

Download

dependencies {
    implementation "dev.rikka.rikkax.material:material-preference:<version>"
}

Usage

Add to your theme:

<!-- Extend this style if you have other custom preferences -->
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Rikka.Material3</item>

Apply this style after super.onCreate in your settings Activity:

context.getTheme().applyStyle(rikka.material.preference.R.style.ThemeOverlay_Rikka_Material3_Preference, true);

Changelog

2.0.0

  • (Breaking change) Use Material 3 style rather than system settings style
  • Add rikka.material.preference.MaterialSwitchPreference which uses MaterialSwitch from Material Components 1.7.0

Note, current version of Material Components (1.7.0-alpha02) requires the user to add <item name="materialSwitchStyle">@style/Widget.Material3.CompoundButton.MaterialSwitch</item> to the theme. If you are using dev.rikka.rikkax.material:material v2.5.0+, this has been already done.

1.0.0

  • Port Preference style from Android 12 system settings