Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Found bug in AnimatorSet's AnimatorListener #52

Open
dimy93 opened this issue Aug 6, 2013 · 3 comments
Open

Found bug in AnimatorSet's AnimatorListener #52

dimy93 opened this issue Aug 6, 2013 · 3 comments

Comments

@dimy93
Copy link

dimy93 commented Aug 6, 2013

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

@gaurav17281
Copy link

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.

@wliuxingxiangyu
Copy link

set the listener before the animation.

@lengthy
Copy link

lengthy commented Sep 6, 2016

\

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants