Android ==> Simple 2d Animation ???

Posted by aryaxt on Stack Overflow See other posts from Stack Overflow or by aryaxt
Published on 2010-06-18T03:22:27Z Indexed on 2010/06/18 3:33 UTC
Read the original article Hit count: 328

Filed under:
|
|
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

© Stack Overflow or respective owner

Related posts about android

Related posts about animation