i'm trying to work out how to organize an android application that will have multiple themes. here's a simplified example of my problem,
2 themes, "light" and "dark", within each theme, two text colors: "enabled" and "disabled"
now the problem is that when i define my TextView, i don't want to call out "light" or "dark" there, i want to just specify the theme at the application level and have it applied. basically, i want CSS selectors. i want to be able to define my theme like,
<style name="Light.enabled" .../>
<style name="Light.disabled" .../>
and my text view like,
<TextView style="@style/.enabled" .../>
<TextView style="@style/.disabled" .../>
and have it apply "enabled" or "disabled" based on whether i've called out "light" or "dark" at the application level.
this page, http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html
shows an app that
defines a style, say "light.enabled"
#000000
defines an attribute reference, say "enabled"
defines a style (theme) item like,
@style/light.enabled
uses the attr to define the style in the view,
this is what i want, but it doesn't work for me. the only diff is that i'm using an appwidget. the author sets the theme on the activity. the only place i can set it is Context.setTheme(), and at the "application" tag in the manifest. neither of which seems to make a difference.