Button btn = (Button) this.fv.findViewById(R.id.btn1);


int x = btn.getLeft();

int y = btn.getTop();


TranslateAnimation moveAnim = new TranslateAnimation(1000, x, y, y); 

//화면밖에서 가로로 이동하여 xml layout의 위치로 이동.

moveAnim.setDuration(1000);   //1초간

moveAnim.setFillAfter(true);    // 애니메이션이 끝난 후, 타겟오브젝트는 애니메이션이 끝난 자리에

moveAnim.setInterpolator(AnimationUtils.loadInterpolator(this.context, android.R.anim.overshoot_interpolator));


btn.setAnimation(moveAnim);



Posted by tenn
,