0

I have a class that extends View, in which I place an instance of a ShapeDrawable, using shapeDrawable.draw(canvas) in the onDraw() method.

I would like to create a translate animation that would move the ShapeDrawable object to another (x,y) position in a given amount of time.

Is there a simple way to achieve this in Android 1.6? Or is there something that I can change in my approach that could help simplify this task?

Cristian Lupascu
  • 39,078
  • 16
  • 100
  • 137

1 Answers1

0

You Could try this Although you would have to add a timer

public void changePos (float dx, float dy) {
    mPosX += dx;
    mPosY += dy;
    this.invalidate ();
}
Cristian Lupascu
  • 39,078
  • 16
  • 100
  • 137