You can do this, but in the opposite direction.  Each of the TextViews
would request a specific "android:style", which you could then define
from the theme through attributes.  Here's an example where I started
doing something like this:

http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/layout/widget_med.xml
http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/values/styles.xml

I didn't write the one last level of indirection needed, which is
where you use attributes, like "?attr/textDay".  Then in the theme
definition you would directly point those attributes at the concrete
"@style/Text.Day" definitions.

To apply various themes in your code, just use ContextThemeWrapper to
wrap a specific theme you've defined.  (Use that wrapper class when
inflating view to make sure they inherit through the attributes
correctly.)

This is pretty complex, but hopefully it will be useful.  This type of
indirect inheritance is used across the platform, and in particular
it's how Theme.Light is implemented.

j


On Wed, Jun 3, 2009 at 1:28 PM, Robert Green <[email protected]> wrote:
>
> Here's my scenario, I have about 6 layouts that all have a TextView
> with the ID "title".  I'm theming my app right now and I'd like to
> have it so that every instance of title gets a specific style
> applied.  Is this possible?
>
> I don't want to use a default text style because normal text will have
> a different size, etc..
> >
>



-- 
Jeff Sharkey
[email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to