florent37 / ViewAnimator

A fluent Android animation library
Apache License 2.0
2.71k stars 423 forks source link

Stop animation #38

Closed danielpassos closed 6 years ago

danielpassos commented 6 years ago

There is a way (method) to stop an animation started?

sandeep2242 commented 6 years ago

I am also having the same issue but I solved using a workaround, I was changing different colors and now I have set only a default color. Still its animating but it doesn't shows.

efraespada commented 6 years ago

@danielpassos @sandeep2242 ViewAnimator methods always return a ViewAnimator object you can instance:

ViewAnimator animation = ViewAnimator.animate(holder.active)
   .waitForHeight()
   .duration(1000)
   .fadeIn()
   .repeatCount(android.view.animation.Animation.INFINITE)
   .start();

animation.cancel();