views:

248

answers:

1

I have a class, TextViewStyled, which extends TextView

In my theme XML, how do I apply a style to all my TextViewStyled widgets on Activities with a chosen theme?

I have this simple theme, but I want to limit the Black Gold style to TextViewStyled Widgets without specifying the Black Gold in the TextViewStyled style attribute. This is one of many themes which will be switched dynamically.:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyThemeOneofMany" parent="android:Theme.NoTitleBar.Fullscreen">
    <item name="android:???????????">@style/TextViewStyled_Black_Gold</item>
    </style>

    <style name="TextViewStyled_Black_Gold" parent="@android:style/Widget.TextView">            
          <item name="android:background">#1E1921</item>        
          <item name="android:textColor">#A85E4F</item>
          <item name="android:textColorLink">#FFBC4F</item>
          <item name="android:textStyle">normal</item>               
      </style>


</resources>
A: 

I found that over riding the base textview class and then after the inflation event, updating the styles worked.

BahaiResearch.com