Hmm... I guess I'm thinking of the way a class of HTML elements are
styled in CSS.  That would be really nice.  Something where I could
say in the theme, "All titles will look like this", and then a UI
element would somehow declare, "I am a title."  I suppose it would be
a next-level thing with theming.  Perhaps theme-by-tag?  I don't know.

On Jun 3, 7:50 pm, Jeff Sharkey <[email protected]> wrote:
> 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/layo...http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/valu...
>
> 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