In the activation of my application there is a list of events consisting of tasks. Tasks are separated by a separator, represented as a RelativeLayout.
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="match_parent" android:layout_height="27dp" android:text="Separator" android:gravity="center_horizontal|center_vertical" android:paddingLeft="16dp" android:textSize="16sp" android:id="@+id/tvSeparatorName"/> </RelativeLayout> I implemented a change of themes in the application. There was a difficulty in changing the color of the separator - in the light theme there should be one shade, in the dark one another.
<color name="backgroundSeparatorLight">#e4f062</color> <color name="backgroundSeparator">#e16d07</color> <resources> <style name="AppThemeLight" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primaryLight</item> <item name="colorPrimaryDark">@color/primaryDarkLight</item> <item name="colorAccent">@color/accentLight</item> <item name="background">@color/backgroundSeparatorLight</item> </style> <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primaryDark</item> <item name="colorAccent">@color/accent</item> <item name="background">@color/backgroundSeparator</item> </style> </resources> How to set the separator background correctly? I would be grateful for the help.