[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread Guillaume Perrot

I didn't realize I was using the "wrong order" in my first test, and
the "right order" in my recent test...
Thanks for the tip hackbod, I'll try to remember that for future
drawables...

On 22 sep, 10:51, hackbod <[EMAIL PROTECTED]> wrote:
> The drawabletries 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:
>
> > http://schemas.android.com/apk/res/android";>
> >     
> >     
> > 
>
> > http://schemas.android.com/apk/res/
> > android">
> >      >         android:drawable="@drawable/progress_circular_background" />
>
> >      >         android:pivotX="50%"
> >         android:pivotY="50%"
> >         android:fromDegrees="0"
> >         android:toDegrees="360"
> >         android:drawable="@drawable/progress_particle" />
> >     
> > 
>
> > I found no documentation for this kind ofdrawable.
>
> > In ItemizedOverlay we can use drawables with state_focused is handled.
> > I tried to pass the followingdrawable(bubble.xml)
>
> >  >   xmlns:android="http://schemas.android.com/apk/res/android";>
> >    >     android:drawable="@drawable/bubble_normal" />
> >    >     android:state_focused="true"
> >     android:drawable="@drawable/bubble_focused" />
> > 
>
> > 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  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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread Guillaume Perrot

Oh, it explains what it fails the first time.
I didn't realize the second time I tested it, I used the "right"
order.
Thanks for that tip !

On 22 sep, 10:51, hackbod <[EMAIL PROTECTED]> wrote:
> The drawabletries 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:
>
> > http://schemas.android.com/apk/res/android";>
> >     
> >     
> > 
>
> > http://schemas.android.com/apk/res/
> > android">
> >      >         android:drawable="@drawable/progress_circular_background" />
>
> >      >         android:pivotX="50%"
> >         android:pivotY="50%"
> >         android:fromDegrees="0"
> >         android:toDegrees="360"
> >         android:drawable="@drawable/progress_particle" />
> >     
> > 
>
> > I found no documentation for this kind ofdrawable.
>
> > In ItemizedOverlay we can use drawables with state_focused is handled.
> > I tried to pass the followingdrawable(bubble.xml)
>
> >  >   xmlns:android="http://schemas.android.com/apk/res/android";>
> >    >     android:drawable="@drawable/bubble_normal" />
> >    >     android:state_focused="true"
> >     android:drawable="@drawable/bubble_focused" />
> > 
>
> > 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  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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread Guillaume Perrot

Luckily, it's what I've done, but I will try to remember that for
future drawables :p

On 22 sep, 10:51, hackbod <[EMAIL PROTECTED]> wrote:
> The  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:
>
> > http://schemas.android.com/apk/res/android";>
> >     
> >     
> > 
>
> > http://schemas.android.com/apk/res/
> > android">
> >      >         android:drawable="@drawable/progress_circular_background" />
>
> >      >         android:pivotX="50%"
> >         android:pivotY="50%"
> >         android:fromDegrees="0"
> >         android:toDegrees="360"
> >         android:drawable="@drawable/progress_particle" />
> >     
> > 
>
> > 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)
>
> >  >   xmlns:android="http://schemas.android.com/apk/res/android";>
> >    >     android:drawable="@drawable/bubble_normal" />
> >    >     android:state_focused="true"
> >     android:drawable="@drawable/bubble_focused" />
> > 
>
> > 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  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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread hackbod

The  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:
>
> http://schemas.android.com/apk/res/android";>
>     
>     
> 
>
> http://schemas.android.com/apk/res/
> android">
>              android:drawable="@drawable/progress_circular_background" />
>
>              android:pivotX="50%"
>         android:pivotY="50%"
>         android:fromDegrees="0"
>         android:toDegrees="360"
>         android:drawable="@drawable/progress_particle" />
>     
> 
>
> 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)
>
>    xmlns:android="http://schemas.android.com/apk/res/android";>
>        android:drawable="@drawable/bubble_normal" />
>        android:state_focused="true"
>     android:drawable="@drawable/bubble_focused" />
> 
>
> 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  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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread Guillaume Perrot

In fact I was hacking "focus" to handle a "selection" mechanism.
It will be useful in a next version of the SDK to have both states
handled.
I also found in the documentation: "It also dispatches Tap and Focus-
change events to optional listeners. "
But we can only listen to focus-change, I had to implement tap
listener myself.

On 22 sep, 10:37, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
> For those who are interested:
>
>   @Override
>   protected boolean onTap(int index)
>   {
>     /* Set focus on tapped item so that he's drawn over others */
>     setFocus(getItem(index));
>
>     /* Consume tap event */
>     return true;
>   }
>
>   @Override
>   public boolean onTap(GeoPoint p, MapView mapView)
>   {
>     /*
>      * Here, the user tapped outside a location bubble, consume event
> to prevent
>      * super to remove the focus.
>      */
>     return true;
>   }
>
> If you recall populate to update your ItemizedOverlay the focus will
> also be lost.
>
> And the sample drawable:
>
> 
>    xmlns:android="http://schemas.android.com/apk/res/android";>
>        android:state_focused="true"
>     android:drawable="@drawable/bubble_focused" />
>        android:drawable="@drawable/bubble_normal" />
> 
>
> On 22 sep, 10:26, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
>
> > > It's probably because MapView doesn't set the state of the bubbles.
>
> > In fact it works well with state_focused, but we have to handle the
> > focus ourself, I had to override the onTap functions to set the focus
> > myself.
> > I am not sure to understand the concept of focused overlay item...
>
> > On 12 sep, 18:16, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>
> > > It's probably because MapView doesn't set the state of the bubbles.
> > > Have you tried android:state_selected?
>
> > > On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot
>
> > > <[EMAIL PROTECTED]> wrote:
>
> > > > I found two interesting drawables in ApiDemos:
>
> > > > http://schemas.android.com/apk/res/android";>
> > > >    
> > > >    
> > > > 
>
> > > > http://schemas.android.com/apk/res/
> > > > android">
> > > >     > > >        android:drawable="@drawable/progress_circular_background" />
>
> > > >     > > >        android:pivotX="50%"
> > > >        android:pivotY="50%"
> > > >        android:fromDegrees="0"
> > > >        android:toDegrees="360"
> > > >        android:drawable="@drawable/progress_particle" />
> > > >    
> > > > 
>
> > > > 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)
>
> > > >  > > >  xmlns:android="http://schemas.android.com/apk/res/android";>
> > > >   > > >    android:drawable="@drawable/bubble_normal" />
> > > >   > > >    android:state_focused="true"
> > > >    android:drawable="@drawable/bubble_focused" />
> > > > 
>
> > > > 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  but I didn't found
> > > > in the documentation which tag to use nor all possible tag list.
>
> > > --
> > > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread Guillaume Perrot

For those who are interested:

  @Override
  protected boolean onTap(int index)
  {
/* Set focus on tapped item so that he's drawn over others */
setFocus(getItem(index));

/* Consume tap event */
return true;
  }

  @Override
  public boolean onTap(GeoPoint p, MapView mapView)
  {
/*
 * Here, the user tapped outside a location bubble, consume event
to prevent
 * super to remove the focus.
 */
return true;
  }

If you recall populate to update your ItemizedOverlay the focus will
also be lost.

And the sample drawable:


http://schemas.android.com/apk/res/android";>
  
  


On 22 sep, 10:26, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
> > It's probably because MapView doesn't set the state of the bubbles.
>
> In fact it works well with state_focused, but we have to handle the
> focus ourself, I had to override the onTap functions to set the focus
> myself.
> I am not sure to understand the concept of focused overlay item...
>
> On 12 sep, 18:16, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>
> > It's probably because MapView doesn't set the state of the bubbles.
> > Have you tried android:state_selected?
>
> > On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > I found two interesting drawables in ApiDemos:
>
> > > http://schemas.android.com/apk/res/android";>
> > >    
> > >    
> > > 
>
> > > http://schemas.android.com/apk/res/
> > > android">
> > >     > >        android:drawable="@drawable/progress_circular_background" />
>
> > >     > >        android:pivotX="50%"
> > >        android:pivotY="50%"
> > >        android:fromDegrees="0"
> > >        android:toDegrees="360"
> > >        android:drawable="@drawable/progress_particle" />
> > >    
> > > 
>
> > > 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)
>
> > >  > >  xmlns:android="http://schemas.android.com/apk/res/android";>
> > >   > >    android:drawable="@drawable/bubble_normal" />
> > >   > >    android:state_focused="true"
> > >    android:drawable="@drawable/bubble_focused" />
> > > 
>
> > > 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  but I didn't found
> > > in the documentation which tag to use nor all possible tag list.
>
> > --
> > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-22 Thread Guillaume Perrot

> It's probably because MapView doesn't set the state of the bubbles.
In fact it works well with state_focused, but we have to handle the
focus ourself, I had to override the onTap functions to set the focus
myself.
I am not sure to understand the concept of focused overlay item...

On 12 sep, 18:16, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> It's probably because MapView doesn't set the state of the bubbles.
> Have you tried android:state_selected?
>
> On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > I found two interesting drawables in ApiDemos:
>
> > http://schemas.android.com/apk/res/android";>
> >    
> >    
> > 
>
> > http://schemas.android.com/apk/res/
> > android">
> >     >        android:drawable="@drawable/progress_circular_background" />
>
> >     >        android:pivotX="50%"
> >        android:pivotY="50%"
> >        android:fromDegrees="0"
> >        android:toDegrees="360"
> >        android:drawable="@drawable/progress_particle" />
> >    
> > 
>
> > 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)
>
> >  >  xmlns:android="http://schemas.android.com/apk/res/android";>
> >   >    android:drawable="@drawable/bubble_normal" />
> >   >    android:state_focused="true"
> >    android:drawable="@drawable/bubble_focused" />
> > 
>
> > 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  but I didn't found
> > in the documentation which tag to use nor all possible tag list.
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable in XML referencing other drawables by state.

2008-09-12 Thread Romain Guy

It's probably because MapView doesn't set the state of the bubbles.
Have you tried android:state_selected?

On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot
<[EMAIL PROTECTED]> wrote:
>
> I found two interesting drawables in ApiDemos:
>
> http://schemas.android.com/apk/res/android";>
>
>
> 
>
> http://schemas.android.com/apk/res/
> android">
>android:drawable="@drawable/progress_circular_background" />
>
>android:pivotX="50%"
>android:pivotY="50%"
>android:fromDegrees="0"
>android:toDegrees="360"
>android:drawable="@drawable/progress_particle" />
>
> 
>
> 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)
>
>   xmlns:android="http://schemas.android.com/apk/res/android";>
>  android:drawable="@drawable/bubble_normal" />
>  android:state_focused="true"
>android:drawable="@drawable/bubble_focused" />
> 
>
> 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  but I didn't found
> in the documentation which tag to use nor all possible tag list.
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---