First, define two colors in /res/values/colors.xml
:
<resources>
<!-- ActionBar-->
<color name="MySpecialTextColorLight">@color/white</color>
<color name="MySpecialTextColorDark">@color/black</color>
<resources>
Then define an attribute with a unique name in /res/values/attrs.xml
:
<resources>
<attr name="mytheme_text_color" format="color"/>
</resources>
Next, define value for this attribute in your two themes, like:
<resources>
<style name="MyTheme" parent="android:Theme">
<item name="mytheme_text_color">@color/MySpecialTextColorDark</item>
</style>
<style name="MyTheme.Light" parent="android:Theme.Light">
<item name="mytheme_text_color">@color/MySpecialTextColorLight</item>
</style>
</resources>
Finally, use the reference attribute you define to refer to these colors. In your case, you use:
<TextView
...
android:color="?attr/mytheme_text_color"
.../>