daimajia/AndroidViewAnimations

Help to stop annimation

AskMeCode opened this issue · 3 comments

Hello all how i can stop animation please:

YoYo.with(animationView).duration(1000).repeat(100).withListener(new Animator.AnimatorListener() {
@OverRide
public void onAnimationStart(Animator animation) {
}
@OverRide
public void onAnimationEnd(Animator animation) {
}
@OverRide
public void onAnimationCancel(Animator animation) {
}
@OverRide
public void onAnimationRepeat(Animator animation) {
}
}).playOn(view);

KieuQ commented

Assign it to a YoYoString variable.
YoYo.YoYoString yoyoString = YoYo.with(animationView) .duration(1000) .repeat(100) .withListener(so on).playOn(view);
then later on your code you can call yoyoString.stop().

@KieuQ
YoYo.YoYoString yoyoString = YoYo.with(Techniques.Tada).duration(1000).repeat(-1).playOn(mBox);

yoyoString.stop() no stop.

assigning animation to yoyoString prevents the animation from starting.