I implement the "night theme". I do not understand how to change the background color of the ListPreference

PreferenceActivity daytime theme:

enter image description here

PreferenceActivity night theme:

enter image description here

As you can see, only the header color picked up from the "night" colors.

I use the following topic:

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> <item name="android:textColor">@color/primary_text</item> <item name="android:textColorSecondary">@color/secondary_text</item> <item name="toolbarStyle">@style/Toolbar</item> <item name="android:windowBackground">@color/background_window</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> <item name="colorControlNormal">@color/icons</item> </style> <style name="AppTheme.Settings" parent="AppTheme" /> 

What parameters are responsible for:

  1. Background ListPreference;
  2. The text color of the ListPreference items;
  3. Color of "switches" ListPreference - I want to replace with "accent" color (in my case orange).

Thanks for the help.

    2 answers 2

    The answer is found - it is a cant standard Android Studio emulator. Genimotion and all the glands display as it should.

    I use the theme above And the file description of the resource-colors in the "values-night" folder

      Try these attributes:

       <item name="android:textColor">@android:color/black</item> <item name="android:textColorAlertDialogListItem">@android:color/black</item> <item name="android:windowBackground">@android:color/transparent</item> 

      And also try redefining the style of the dialog:

       <item name="android:dialogTheme">@style/MyDialogStyle</item> <item name="android:alertDialogTheme">@style/MyDialogStyle</item> <style name="MyDialogStyle" parent="Theme.AppCompat.Light.Dialog"> <item name="colorAccent">@color/material_indigo_500</item> <item name="android:textColor">@android:color/black</item> <item name="android:textColorAlertDialogListItem">@android:color/black</item> <item name="android:windowBackground">@android:color/transparent</item> </style>