The <selector> drawable tries each item in order, until it finds the
first that matches the current state.  So you want the one with the
least specific state (in this case the one that requires no states) to
be after ones with more specific state requirements.

On Sep 12, 4:00 am, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
> I found two interesting drawables in ApiDemos:
>
> <selector xmlns:android="http://schemas.android.com/apk/res/android";>
>     <item android:state_pressed="true" android:drawable="@drawable/
> black_opaque_box" />
>     <item android:drawable="@drawable/black_box" />
> </selector>
>
> <layer-list xmlns:android="http://schemas.android.com/apk/res/
> android">
>     <item
>         android:drawable="@drawable/progress_circular_background" />
>
>     <item><rotate
>         android:pivotX="50%"
>         android:pivotY="50%"
>         android:fromDegrees="0"
>         android:toDegrees="360"
>         android:drawable="@drawable/progress_particle" />
>     </item>
> </layer-list>
>
> I found no documentation for this kind of drawable.
>
> In ItemizedOverlay we can use drawables with state_focused is handled.
> I tried to pass the following drawable (bubble.xml)
>
> <selector
>   xmlns:android="http://schemas.android.com/apk/res/android";>
>   <item
>     android:drawable="@drawable/bubble_normal" />
>   <item
>     android:state_focused="true"
>     android:drawable="@drawable/bubble_focused" />
> </selector>
>
> Unfortunately, my map always show bubble_normal even if there is a
> focused item (I checked that).
> I suppose I have to use another tag than <selector> but I didn't found
> in the documentation which tag to use nor all possible tag list.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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