I want the change the look of the preferences screen for an app I am working on. On some phones the preferences are very translucent and it is quite difficult to read the preferences scheme, so I am going to change the visuals for it.
My question is how can I apply a theme to the preferences scheme? Or failing that, how can I change the text color that show up for the various preferences.
In my current version, my preferences layout xml file starts with:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffa0a0a0">
This background color gives me an acceptable gray, but I would prefer to use a theme.
I tried putting a applying a couple of different themes in the preferences xml and the preferences layout xml and none of this has shown any effect. I also tried setting andoid:textColor for the individual preferences items and in layout and that had no effect.
So how does one modify the visuals for the preferences scheme (preferably by using a theme)?
thanks in advance,
Jay
The basic things are:
preferenceScreenStyle
, preferenceCategoryStyle
etc)themes.xml
). For instance in styles.xml they define the Preference.Category
and Preference.PreferenceScreen
styles.<activity android:theme="@style/CustomTheme"...
If you want to inherit the default Android styles and then just override some of them, then add parent="@android:style/Theme"
to the opening <style...
tag of your theme.
Take a look at Applying Styles and Themes for more info.