Slions Preference is an Android Kotlin library which builds upon Jetpack Preference and Material Components. Notably used by Fulguris.
This library is published on Maven Central as net.slions.android:preference. You can use it in your own Android project by adding it to your depenencies:
dependencies {
implementation "net.slions.android:preference:0.0.5"
}
Make sure your preference fragments are derived from slions.pref.PreferenceFragmentBase.
This will notably take care of using a compatible preferenceTheme if none was specified in your theme styles. Failing to do so or using an incompatible preferenceTheme can lead to crashes.
You can define your own preferenceTheme attribute in your theme styles. Like so:
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Slions.Custom</item>
Run and explore the demo application and code documentation for more information.
Extend the basic preference with convenient features and tricks.
Easily build a list preference from an enum.
Preference using a Material Slider.
Increase the library version number from lib/build.gradle.kts.
Generate your upload package by running:
.\gradlew generateUploadPackage
If signing hangs and fails on Windows, launch Kleopatra to make sure gpg-agent is running.
It outputs a file named preference.zip in the following folder lib\build\distributions. You can directly upload this ZIP file for publication on Maven Central.