开发者

How can I use an animation at the end of another animation

开发者 https://www.devze.com 2023-03-04 02:25 出处:网络
I am using following code for rotating an image RotateAnimation anim1 = new RotateAnimation(0, 360, 8, 70);

I am using following code for rotating an image

RotateAnimation anim1 = new RotateAnimation(0, 360, 8, 70);
anim1.setRepeatCount(0);
anim1.setDuration(18000);
anim1.setFillAfter(true);
img7.startAnimation(anim1);

After that I am using another animation

RotateAnimation anim1 = new RotateAnimation(360, 0, 8, 70);
anim1.setRepeatCount(0);
anim1.setDuration(18000);
anim1.setFil开发者_JS百科lAfter(true);
img7.startAnimation(anim1);

When I am using both the animations without any action listener one of them will work....What I actually want, is at the end of the first animation, for the second animation to start...Can anybody help me to do this?

I am not using any XML code for animation.


Why won't you use Animation.AnimationListener for the first animation (setAnimationListener()) and launch the second when the first one finishes?


I think AnimatorSet was designed for this. Demo in the sdk.

0

精彩评论

暂无评论...
验证码 换一张
取 消