Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.AndroidDeveloperLB:MaterialpreferenceLibrary:14'
}
dependencies {
implementation("com.github.AndroidDeveloperLB:MaterialpreferenceLibrary:14")
}
<dependency>
<groupId>com.github.AndroidDeveloperLB</groupId>
<artifactId>MaterialpreferenceLibrary</artifactId>
<version>14</version>
</dependency>
libraryDependencies += "com.github.AndroidDeveloperLB" % "MaterialpreferenceLibrary" % "14"
:dependencies [[com.github.AndroidDeveloperLB/MaterialpreferenceLibrary "14"]]
Note : This library is not developed anymore, as there is an official way to support old Android versions with preferences that have same material design style, by using PreferenceFragmentCompat : https://developer.android.com/reference/android/support/v7/preference/PreferenceFragmentCompat
Allows to have a nice Material-Design look&feel for API 14 (even below if you use release 10 of the library) and above for the PreferenceActivity, including most commonly used preferences and also showing the actionBar. All the dialogs are using the support library's dialogs, including accent-color. You can even choose which theme to use.
Supported preferences are:
In addition to all of those, I've disabled the truncating of the text of all the supported preferences, so that translated text will still be fully shown. Do try ot make them short though.
Via gradle :
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
dependencies {
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:###'
}
where "###" is the number as shown here: https://jitpack.io/#AndroidDeveloperLB/MaterialPreferenceLibrary/ .
Just check the code (it has a sample inside), or see how it works on my app, here:
<a href="https://play.google.com/store/apps/details?id=com.lb.app_manager"> <img alt="sample app" src="en_app_rgb_wo_60.png" /> </a>Here's a demo of how the library performs on both Gingerbread and Lollipop, including how the native preferences look and behave:
Contribution is appreciated. Please try to be "loyal" to the original code of Android, as I've tried.
This library needs:
That's it.
Android's code ?
It's Apache2 . Do with it what you wish. Credits are appreciated :)