Ok, delving deeper into the source code I have come up with a
solution, though I feel like it is the poor man's solution.

Overlay has two draw methods.  The one that handles animations is this
one:
public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
long when)

In my extended Overlay class I override this method and include code
to draw my animations.  I set up my class with additional control
members:
int animating;  // 0 for not animating; 1 for animating but need a
start time; and 2 for animating and have start time
long startTime;  // holds the start time of the animation
int animationDuration = 700;  // set to have animation last for 700
milliseconds

In the draw method:
if (animating == 1)
{
  startTime = when;
  animating = 2;
}

if (animating == 2)
{
  // draw to canvas code
  return true;
}
else
{
  draw(canvas, mapView, shadow);  // I am not animating so call the
non-animation draw
  return false;
}

The code where you draw to the canvas has to handle your animation.
In my program I am setting the color of a rectangle to animate between
it's color and white.  In my constructor I preset values for how much
the color should change each millisecond.  I use that value to change
the color that much times the number of milliseconds that have passed
from startTime.  ((when - startTime) % animationDuration)

I have not figured out a way to associate an Animation with an
Overlay.  If someone wants to point me in the direction to do that it
would be helpful.  This solution works well enough for me right now
though.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to