NineOldAndroids icon indicating copy to clipboard operation
NineOldAndroids copied to clipboard

Found bug in AnimatorSet's AnimatorListener

Open dimy93 opened this issue 12 years ago • 3 comments

I have the following code : AnimatorSet set = new AnimatorSet ( ); ObjectAnimator oax = ObjectAnimator.ofFloat ( layout, "scaleX", scalingSt, scalingEn ); ObjectAnimator oay = ObjectAnimator.ofFloat ( layout, "scaleY", scalingSt, scalingEn ); set.playTogether ( oax, oay ); set.setDuration ( 800 ); set.setStartDelay ( waitMilis ); set.start ( ); set.addListener ( listener ); For some reason the registered set's listener would not call OnAnimationStart. I guess the problem is that the set do not call it as OnAnimationEnd is being called properly. What I did to bypass the problem was to register listener to oax. Hope this would save somebody little time

dimy93 avatar Aug 06 '13 13:08 dimy93

You need to set the listener before the animation. The problem here is the animation has already started before the listener is added, whereas listener is already present when the animation ends.

gaurav17281 avatar Aug 07 '13 17:08 gaurav17281

set the listener before the animation.

wliuxingxiangyu avatar Sep 05 '16 07:09 wliuxingxiangyu

\

lengthy avatar Sep 06 '16 03:09 lengthy