On Android 4.x I want to change the default color (here is blue) when an item is pressed in Preference:
How can I do that? Thank you very much guys!
On Android 4.x I want to change the default color (here is blue) when an item is pressed in Preference:
How can I do that? Thank you very much guys!
You should redefine the color accent for Preferences in your styles.xml for example:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
// your relevant items
<item name="preferenceTheme">@style/PreferenceTheme</item>
</style>
<style name="PreferenceTheme" parent="@style/PreferenceThemeOverlay.v14.Material">
<item name="colorAccent">@color/colorAccent</item> // here for the ripple color
<item name="android:textColorPrimary">@color/textColorPrimary</item>
<item name="android:textColorSecondary">@color/textColorSecondary</item>
</style>
</resources>
parent="@style/PreferenceThemeOverlay.v14.Material"
it is to get a material style like , you can use this parent by addind in your build.gradle :
compile 'com.android.support:preference-v14:25.3.1'
Sorry for my english.
Hope this help .