[android-developers] Re: AnimationDrawable on ItemizedOverlay

2012-06-12 Thread Josh Lentz
Felix:

Can you post the code of how you got this to work. I am trying to make a 
custom AnimationDrawable to replace the the default on that 
MyLocationOverlay uses.

I have made a subclass of MyLocationOverlay but it will only show the first 
image in the animation-list.

I have tried a Runnable and a Handler and nothing works for me.

If you can help that would be great!

On Wednesday, June 22, 2011 5:09:26 AM UTC-4, Felix Garcia Lainez wrote:

 Ok i have done animating myself using a handler and it works. Thanks! 

 On 21 jun, 20:55, TreKing treking...@gmail.com wrote: 
  On Tue, Jun 21, 2011 at 1:38 PM, Felix Garcia Lainez  
  
  fgarcialai...@gmail.com wrote: 
   Yes i did, and just tested doing before and after adding 
 ItemizedOverlay to 
   the map overlays array. 
  
  Well, I'm out of ideas. If you don't get an answer to make this work the 
 way 
  it should, perhaps make you own animator for this case. 
  It shouldn't be terribly difficult to make your own animated 
 ItemizedOverlay 
  by using the AnimationDrawable functions to get each frame with a timer 
 in 
  between as necessary. 
  
  
 --- 
 -- 
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
  transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-22 Thread Felix Garcia Lainez
Ok i have done animating myself using a handler and it works. Thanks!

On 21 jun, 20:55, TreKing treking...@gmail.com wrote:
 On Tue, Jun 21, 2011 at 1:38 PM, Felix Garcia Lainez 

 fgarcialai...@gmail.com wrote:
  Yes i did, and just tested doing before and after adding ItemizedOverlay to
  the map overlays array.

 Well, I'm out of ideas. If you don't get an answer to make this work the way
 it should, perhaps make you own animator for this case.
 It shouldn't be terribly difficult to make your own animated ItemizedOverlay
 by using the AnimationDrawable functions to get each frame with a timer in
 between as necessary.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-21 Thread Felix Garcia Lainez
But how do i do this if i haven't any imageview to show the animation?
I have seen this on documentation, but for an overlay is slightly
different...

!-- Animation frames are wheel0.png -- wheel5.png files inside the
 res/drawable/ folder --
 animation-list android:id=selected android:oneshot=false
item android:drawable=@drawable/wheel0 android:duration=50 /
item android:drawable=@drawable/wheel1 android:duration=50 /
item android:drawable=@drawable/wheel2 android:duration=50 /
item android:drawable=@drawable/wheel3 android:duration=50 /
item android:drawable=@drawable/wheel4 android:duration=50 /
item android:drawable=@drawable/wheel5 android:duration=50 /
 /animation-list
Here is the code to load and play this animation.

 // Load the ImageView that will host the animation and
 // set its background to our AnimationDrawable XML resource.
 ImageView img = (ImageView)findViewById(R.id.spinning_wheel_image);
 img.setBackgroundResource(R.drawable.spin_animation);

 // Get the background, which has been compiled to an
AnimationDrawable object.
 AnimationDrawable frameAnimation = (AnimationDrawable)
img.getBackground();

 // Start the animation (looped playback by default).
 frameAnimation.start()

On 21 jun, 18:21, TreKing treking...@gmail.com wrote:
 On Tue, Jun 21, 2011 at 11:15 AM, Felix Garcia Lainez 

 fgarcialai...@gmail.com wrote:
  Is there any way to show a gif animated or animationdrawable (to do
  something like MyLocationOverlay) on an ItemizedOverlay? Really i
  don't see an easy way to do this...

 You of course tried setting an AnimationDrawable as the ItemizedOverlay's
 Drawable already ... ?

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-21 Thread TreKing
On Tue, Jun 21, 2011 at 12:04 PM, Felix Garcia Lainez 
fgarcialai...@gmail.com wrote:

 But how do i do this if i haven't any imageview to show the animation?


Honestly, don't know, but I would assume
http://developer.android.com/reference/android/content/res/Resources.html#getDrawable(int)

Would return you the AnimationDrawable from the resource ID which you could
pass to the ItemizedOverlay.

Keyword being assume ;-). Try it.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-21 Thread Felix Garcia Lainez
Just tested and doesn't work... It is shown only the 1st image of the
animation list..

On 21 jun, 19:44, TreKing treking...@gmail.com wrote:
 On Tue, Jun 21, 2011 at 12:04 PM, Felix Garcia Lainez 

 fgarcialai...@gmail.com wrote:
  But how do i do this if i haven't any imageview to show the animation?

 Honestly, don't know, but I would 
 assumehttp://developer.android.com/reference/android/content/res/Resources)

 Would return you the AnimationDrawable from the resource ID which you could
 pass to the ItemizedOverlay.

 Keyword being assume ;-). Try it.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-21 Thread TreKing
On Tue, Jun 21, 2011 at 12:49 PM, Felix Garcia Lainez 
fgarcialai...@gmail.com wrote:

 Just tested and doesn't work... It is shown only the 1st image of
 the animation list..


Did you call start() on the AnimationDrawable? (More assumptions)

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-21 Thread Felix Garcia Lainez
Yes i did, and just tested doing before and after adding
ItemizedOverlay to the map overlays array.

On 21 jun, 20:19, TreKing treking...@gmail.com wrote:
 On Tue, Jun 21, 2011 at 12:49 PM, Felix Garcia Lainez 

 fgarcialai...@gmail.com wrote:
  Just tested and doesn't work... It is shown only the 1st image of
  the animation list..

 Did you call start() on the AnimationDrawable? (More assumptions)

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: AnimationDrawable on ItemizedOverlay

2011-06-21 Thread TreKing
On Tue, Jun 21, 2011 at 1:38 PM, Felix Garcia Lainez 
fgarcialai...@gmail.com wrote:

 Yes i did, and just tested doing before and after adding ItemizedOverlay to
 the map overlays array.


Well, I'm out of ideas. If you don't get an answer to make this work the way
it should, perhaps make you own animator for this case.
It shouldn't be terribly difficult to make your own animated ItemizedOverlay
by using the AnimationDrawable functions to get each frame with a timer in
between as necessary.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en