Android examples for android.view.animation:Animation
set Listeners for Animator
import android.animation.Animator; import android.os.Handler; import android.view.View; public class Main { static void setListeners(final View target, Animator anim, final Animator animator, final int duration) { anim.addListener(new Animator.AnimatorListener() { @Override// ww w . j a v a 2 s.c o m public void onAnimationStart(Animator animat) { if (target.getVisibility() == View.INVISIBLE) { target.setVisibility(View.VISIBLE); } new Handler().postDelayed(new Runnable() { @Override public void run() { animator.start(); } }, duration - 100); } @Override public void onAnimationEnd(Animator animator) { } @Override public void onAnimationCancel(Animator animator) { } @Override public void onAnimationRepeat(Animator animator) { } }); } }