In my Android app, I use various custom themes in different actions, all of which work fine. All of these themes use the same custom styles for buttons, editing controls, etc.
My preferences use the standard Preference actions, which I define in XML and style through the manifest.
However, when I have a preference for triggering a warning dialog box, such as ListPreference, the standard buttons are used in the dialog box. It seems to use my EditText style in EditTextPreference ... but not my background or text color.
Does anyone know why this is happening?
Some of the code:
Styles
<style name="Theme.Prefs" parent="@android:style/Theme.Holo.Light"> <item name="android:windowBackground">@drawable/background</item> <item name="android:buttonStyle">@style/CustomButtonStyle</item> <item name="android:editTextStyle">@style/CustomEditTextStyle</item> </style> <style name="CustomButtonStyle" parent="@android:style/Widget.Holo.Button"> <item name="android:background">@drawable/custom_button</item> <item name="android:textSize">@dimen/dialog_text_size_normal</item> <item name="android:textColor">@color/dialog_control_colour</item> </style> <style name="CustomEditTextStyle" parent="@android:style/Widget.Holo.EditText"> <item name="android:background">@drawable/custom_textfield</item> <item name="android:textColor">@color/dialog_control_colour</item> <item name="android:textSize">@dimen/dialog_text_size_normal</item> </style>
And in the manifest:
<activity android:name="com.breadbun.prefs.MainPreferencesActivity" android:theme="@style/Theme.Prefs" android:screenOrientation="portrait"> </activity>
source share