Android AnimatorSet animation + setStartDelay VS AnimatorListenener.onAnimationStart?

I have a question about an Android AnimatorSet object. I am trying to create a TextView dynamically and set its visibility to GONE and make it appear when my animation starts after a delayed start. To achieve this, I installed the onAnimationStart listener to tell me when the animation starts so that I can display the TextView. I add a TextView to the AnimatorSet to perform some animations in alpha and translateY, but also set setStartDelay so that the animation starts at 2500 milliseconds. My problem is that I want the TextView to become visible when the animation starts at 2500 millimeters, but onAnimationStart only gets called when my AnimatorSet.start () function is called, not the requested 2500 milliseconds after. This leads tothat my TextView becomes visible before they start animating (after the setStartDelay period). How can I overcome this and get TextView objects so that they only appear after the setStartDelay period ???? Thank you so much, you are the best StackOverflow !!!! :) :) :)

+5
source share
1 answer

I had the same problem. I am animating 3 ValueAnimators in an AnimatorSet. I did "playTogether ()" in my set as follows:

set.playTogether(alpha,animScale,transY);
set.start();

And found that the delay in the animation caused problems. Instead, I tried the following:

set.play(animScale);
set.play(transY);
set.play(alpha);
set.start();

Seems to work!

+2
source

All Articles