If the app has the ability to switch between different app color themes, every view must use a style or refer to a custom ?attr/
for all colors.
attrs.xml
has:
<attr name="subtitle_1_color" format="color"/>
Which is mapped in styles.xml
:
<style name="AppTheme.Dark">
<item name="subtitle_1_color">@color/white</item>
</style>
<style name="AppTheme.Light">
<item name="subtitle_1_color">@color/dark_gray</item>
</style>
<style name="Subtitle_1">
<item name="text_color">?attr/subtitle_1_color</item>
<item name="text_size">@dimen/subtitle_1_text_size</item>
</style>
Usage in layout:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/tos_accept_button_title"
style="@style/Subtitle_1"/>