Android ==> Simple 2d Animation ???
- by aryaxt
public void MoveMyButton (int x) //where the button suppose to move to
{
TranslateAnimation anim=new TranslateAnimation(this.getLeft() ,x, this.getTop() ,20));
anim.setFillAfter(true);
anim.setDuration(1000);
this.setAnimation(anim);
anim.start();
}
button's x at start is 1.
I call the method to move it to 100, and it goes from 1 to 100
I call it to go to 200, and it goes from 1 to 200, instead of 100 to 200
Is there any way to make the animation to save the location of the button as it animates it?
Thanks