Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Unable to repeat animation with timer #36

Open
gensin opened this issue Oct 11, 2017 · 1 comment
Open

Unable to repeat animation with timer #36

gensin opened this issue Oct 11, 2017 · 1 comment

Comments

@gensin
Copy link

gensin commented Oct 11, 2017

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?

@efraespada
Copy link

efraespada commented Dec 20, 2017

@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();

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

2 participants