{"id":17299384,"url":"https://github.com/maxr1998/modernandroidpreferences","last_synced_at":"2025-09-23T17:01:44.129Z","repository":{"id":37923680,"uuid":"149008923","full_name":"Maxr1998/ModernAndroidPreferences","owner":"Maxr1998","description":"Android Preferences defined through Kotlin DSL, shown in a RecyclerView","archived":false,"fork":false,"pushed_at":"2025-09-17T17:47:27.000Z","size":2333,"stargazers_count":120,"open_issues_count":17,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-17T19:56:22.436Z","etag":null,"topics":["android","android-library","kotlin","kotlin-android","kotlin-dsl","preferences"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Maxr1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Maxr1998"]}},"created_at":"2018-09-16T15:29:20.000Z","updated_at":"2025-08-01T01:27:53.000Z","dependencies_parsed_at":"2023-11-23T12:24:42.799Z","dependency_job_id":"c01362a1-fb39-4043-9cfe-dd0bca0227ed","html_url":"https://github.com/Maxr1998/ModernAndroidPreferences","commit_stats":{"total_commits":514,"total_committers":7,"mean_commits":73.42857142857143,"dds":"0.24708171206225682","last_synced_commit":"30aa7cd8363842071df2446b1fa13aada69a0870"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/Maxr1998/ModernAndroidPreferences","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxr1998%2FModernAndroidPreferences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxr1998%2FModernAndroidPreferences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxr1998%2FModernAndroidPreferences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxr1998%2FModernAndroidPreferences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maxr1998","download_url":"https://codeload.github.com/Maxr1998/ModernAndroidPreferences/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxr1998%2FModernAndroidPreferences/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276613292,"owners_count":25673399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","kotlin","kotlin-android","kotlin-dsl","preferences"],"created_at":"2024-10-15T11:22:14.954Z","updated_at":"2025-09-23T17:01:43.624Z","avatar_url":"https://github.com/Maxr1998.png","language":"Kotlin","funding_links":["https://github.com/sponsors/Maxr1998"],"categories":[],"sub_categories":[],"readme":"# ModernAndroidPreferences\n\n[![GitHub release](https://img.shields.io/github/v/release/Maxr1998/ModernAndroidPreferences)](https://github.com/Maxr1998/ModernAndroidPreferences/releases)\n[![Maven Central](https://img.shields.io/maven-central/v/de.maxr1998/modernandroidpreferences)](https://repo.maven.apache.org/maven2/de/maxr1998/modernandroidpreferences/)\n[![Build status](https://img.shields.io/github/actions/workflow/status/Maxr1998/ModernAndroidPreferences/library-test.yaml?branch=master)](https://github.com/Maxr1998/ModernAndroidPreferences/actions/workflows/library-test.yaml)\n[![Lint status](https://img.shields.io/github/actions/workflow/status/Maxr1998/ModernAndroidPreferences/library-lint.yaml?branch=master\u0026label=detekt%20%26%20lint)](https://github.com/Maxr1998/ModernAndroidPreferences/actions/workflows/library-lint.yaml)\n[![License](https://img.shields.io/github/license/Maxr1998/ModernAndroidPreferences)](https://github.com/Maxr1998/ModernAndroidPreferences/blob/master/LICENSE)\n\nAndroid preferences in Kotlin DSL, displayed in a RecyclerView.\n\n_No XML, no troubles with PreferenceManager, Fragments, or styling, no more ListView._ :tada:\n\n### Code example\n```Kotlin\n// Setup a preference screen\nval screen = screen(context) {\n    pref(\"first\") {\n        title = \"A preference\"\n        summary = \"Click me to do stuff\"\n        click {\n            doStuff()\n        }\n    }\n    pref(\"second\") {\n        title = \"Another one\"\n        iconRes = R.drawable.preference_icon_24dp\n    }\n    categoryHeader(\"more\") {\n        titleRes = R.string.category_more\n    }\n    switch(\"toggle_feature\") {\n        title = \"Also supports switches\"\n    }\n    // and many other preference widgets!\n}\n\n// Wrap the created screen in a preference adapter…\nval preferencesAdapter = PreferencesAdapter(screen)\n\n// …that can be attached to a RecyclerView\nrecyclerView.adapter = preferencesAdapter\n```\n\n### Example app\nExample Activities ([with](https://github.com/Maxr1998/ModernAndroidPreferences/tree/master/testapp/src/main/java/de/Maxr1998/modernpreferences/example/view_model) and [without](https://github.com/Maxr1998/ModernAndroidPreferences/blob/master/testapp/src/main/java/de/Maxr1998/modernpreferences/example/TestActivity.kt) using ViewModel)\nshow advanced info like back handling, saving/restoring scroll position, and using the `OnScreenChangeListener`.\n\n### Screenshots\n\u003cdetails\u003e\n  \u003csummary\u003eClick to show\u003c/summary\u003e\n\n| ![](screenshots/screenshot_1.png) | ![](screenshots/screenshot_2.png) |\n|:---------------------------------:|:---------------------------------:|\n\n\u003c/details\u003e\n\n## Include to project\nModernAndroidPreferences is on [Maven Central](https://search.maven.org/artifact/de.maxr1998/modernandroidpreferences),\nso you can get it like any other dependency:\n\n```gradle\ndependencies {\n    implementation 'de.maxr1998:modernandroidpreferences:2.3.2'\n}\n```\n\n---\n\n**NOTE:** This library has previously been available as `de.Maxr1998.android:modernpreferences` on Bintray JCenter,\nbut was migrated to Sonatype Maven Central in light of the impending JCenter sunsetting.  \nTo get in line with Maven naming standards, it was renamed to `de.maxr1998:modernandroidpreferences`.\n\n## License\nCopyright © 2018-2021  Max Rumpf alias Maxr1998\n\nThis library is released under the Apache License version 2.0.\nIf you use this library (or code from it) in your projects, crediting me is appreciated.\n\nThe example application however is licensed under the GNU General Public version 3, or any later version.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxr1998%2Fmodernandroidpreferences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxr1998%2Fmodernandroidpreferences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxr1998%2Fmodernandroidpreferences/lists"}