AndroidViewAnimations
AndroidViewAnimations copied to clipboard
delay() doesn't work on onAnimationStart()
YoYo.with(Techniques.FadeInDown) .duration(500) .delay(2000) .withListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { textView.setVisibility(View.VISIBLE); } ... }) .playOn(textView);
onAnimationStart() will be called immediately when I call playOn() so I have to fix it like this:
new Handler().postDelayed(new Runnable() { @Override public void run() { YoYo.with(Techniques.FadeInDown) .duration(500) .withListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { textView.setVisibility(View.VISIBLE); } ... }) .playOn(textView); } },2000);