ViewGroup rootView = (ViewGroup) this.getWindow().getDecorView();
TranslateAnimation animation = new TranslateAnimation(
0, 300, 0, 0);
animation.setDuration(3000);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.i("zt", "onAnimationStart");
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.i("zt", "onAnimationRepeat");
}
@Override
public void onAnimationEnd(Animation animation) {
Log.i("zt", "onAnimationEnd");
}
});
rootView.startAnimation(animation);
TranslateAnimation animation = new TranslateAnimation(
0, 300, 0, 0);
animation.setDuration(3000);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.i("zt", "onAnimationStart");
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.i("zt", "onAnimationRepeat");
}
@Override
public void onAnimationEnd(Animation animation) {
Log.i("zt", "onAnimationEnd");
}
});
rootView.startAnimation(animation);