ViewAnimator
ViewAnimator copied to clipboard
Unable to repeat animation with timer
I'm experimenting an issue trying to repeating an animation with a timer. I have the following method:
ViewAnimator.animate(buttonStart) .rotation(360) .duration(2000) .decelerate() .start();
And a timer which call this methods every 4 seconds. It works always the first time but never again in the sequence although the method call is working. Why is this happening? Why I only can call to the animation once? Am I doing something wrong?
@gensin you can use repeatCount
method for that purpose:
ViewAnimator.animate(buttonStart)
.rotation(360)
.duration(4000) // 4 seconds
.decelerate()
.repeatCount(android.view.animation.Animation.INFINITE)
.start();