I have a root theme and an inheriting child theme:
<resources>
<color name="colorRed">#FF0000</color>
<color name="colorGreen">#00FF00</color>
<style name="Root" parent="Theme.AppCompat.Light.DarkActionBar" />
<style name="Root.TextAppearance" parent="android:TextAppearance">
<item name="android:textColor">@color/colorGreen</item>
</style>
<style name="Child" parent="Root">
<item name="android:textColor">@color/colorRed</item>
</style>
</resources>
In the manifest file I set the theme Child
. In the layout I apply the text appearance from the root theme:
<TextView
android:textAppearance="@style/Root.TextAppearance"
android:text="Hello World!"
- Expected: green text
- Actual: red text
How does the Root.TextAppearance
inherit the color red?