With some searching I've found several examples and explanations of
customizing the look of a component based on the drawing states. But I
haven't found anything about defining custom drawing states. For
instance, suppose I have a component that maintains states that I
might call "baked" and "fried" and I want it's appearance to track
these states. So I'm imagining this drawable:

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
<item android:drawable="@drawable/item_baked" state_baked="true"
state_fried="false" />
<item android:drawable="@drawable/item_fried" state_baked="false"
state_fried="true" />
<item android:drawable="@drawable/item_overcooked" state_baked="true"
state_fried="true" />
<item android:drawable="@drawable/item_raw" state_baked="false"
state_fried="false" />
</selector>

Is this possible? I see that it is possible (with setState,
mergeDrawableStates, etc.) to have custom state data, but I don't see
how to put this to use. I can't figure out from the documentation
whether it is even possible to define custom item state attributes in
xml, much less how to do it and link them to the state vector. (I'm
assuming that if this is possible, I could also mix custom attributes
with standard ones like android:state_pressed.) A pointer to an
example or two would be very helpful.

Thanks.
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to