android - Check if AnimatorSet has finished animation? -


itemprop = "text">

AnimatorSet

to animate the button with fade in the animation by using I

Button in Fade & gt; Click the button & gt; The remaining button fades out

Then to do this, I want to set the onClickListner animation after completion, but it does not work Clicking a button in the middle of the animation starts onclick action :

  setQuestion = new AnimatorSet (); SetQuestion.playSequentially (fadeinAnimationQ, fadeinAnimation1, fadeinAnimation2, fadeinAnimation3, fadeinAnimation4, fadeinAnimation5); SetQuestion.start ();  

This is the method that checks for , then the animation is finished .

  Private Zero checkAnimation () {While (correct) {// Check that the animation is finished if set (.all () == incorrect) {assigninelisters (); break; }}}  

You can set Fidin animation to 5. This will give you an onAnimationEnd callback.

  fadeinAnimation5.addListener (New AnimatorListener () {@Override public void onAnimationStart (Animator animation) {// ...} @Override public void onAnimationRepeat (Animator animation) {// ... } @Override Public Zero onAnimationEnd (Animator Animation) {// ...} @Override Public Zero onAnimationCancel (Animator Animation) {// ...}});  

or suggested by the use

  fadeinAnimation5.addListener (New AnimatorListenerAdapter () {@Override public void onAnimationEnd (Animator animation) {/ / .. ..}}  

Comments