Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Latest release Build status License

Android Preferences defined through Kotlin DSL, shown in a RecyclerView.
No XML, no awful PreferenceManager, Fragments or styling problems, no more ListView. 🎉

Code example

// Setup a preference screen
val screen = screen(context) {
    pref("first") {
        title = "A preference"
        summary = "Click me to do stuff"
        click {
    pref("second") {
        title = "Another one"
        iconRes = R.drawable.preference_icon_24dp
    categoryHeader("more") {
        titleRes = R.string.category_more
    switch("toggle_feature") {
        title = "Also supports switches"
    // and many other preference widgets!

// Wrap the created screen in a preference adapter…
val preferencesAdapter = PreferencesAdapter(screen)

// …that can be attached to a RecyclerView
recyclerView.adapter = preferencesAdapter

View the example app

Example Activities (with and without using ViewModel) show advanced info like back handling, saving/restoring scroll position, and using the OnScreenChangeListener.

Include to project

ModernAndroidPreferences is on Bintray, so you can get it like any other dependency via JCenter:

dependencies {
    implementation ''


Copyright © 2018-2020 Max Rumpf alias Maxr1998

This library is released under the Apache License version 2.0. If you use this library (or code inspired by it) in your projects, crediting me is appreciated.

The example application however is licensed under the GNU General Public version 3, or any later version.

You can’t perform that action at this time.