Thank you.
I tried this:
<item android:state_selected="true" android:state_checked="false"
android:drawable="@drawable/off_focus" />
<item android:state_selected="true" android:state_checked="true"
android:drawable="@drawable/on_focus" />
But the image still does not switch when my widget has the focus. It
still uses the 'orange rectangle boundary when it get the focus. I
think that is the default. I just want to change it to 2 different
images when it get the focus for my widget. Again, these works for my
widget now:
<item android:state_checked="false" android:drawable="@drawable/off" />
<item android:state_checked="true" android:drawable="@drawable/on" />
So I appreciate if you can help me out.
Thank you.
On Sun, Feb 15, 2009 at 12:32 AM, Romain Guy <[email protected]> wrote:
>
> use state_selected, not focused.
>
> On Sun, Feb 15, 2009 at 12:08 AM, Meryl Silverburgh
> <[email protected]> wrote:
>>
>> Hi,
>>
>> I am trying to setup a selector drawable in my asset file like this:
>> * 2 different images for 'on'/'off' mode in rest mode (i.e. it does
>> not has focus)
>> * another 2 different images for 'on'/'off' mode in focus mode (i.e.
>> it has the focus).
>>
>> In my case, the rest mode works, but the 'focus' mode does not.
>>
>> Can you please tell me what am I missing in the focus mode? Thank you.
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <selector xmlns:android="http://schemas.android.com/apk/res/android">
>>
>> <!-- these 2 images works --->
>> <item android:state_checked="false" android:drawable="@drawable/off" />
>> <item android:state_checked="true" android:drawable="@drawable/on" />
>>
>>
>> <!-- these 2 images does not work -->
>> <item android:state_focused="true" android:state_checked="false"
>> android:drawable="@drawable/off_focus" />
>> <item android:state_focused="true" android:state_checked="true"
>> android:drawable="@drawable/on_focus" />
>>
>> </selector>
>>
>> >
>>
>
>
>
> --
> Romain Guy
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support. All such questions should be posted on
> public forums, where I and others can see and answer them
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---