How to repeat an AnimationSet with sequentially added animations
For what its worth, setRepeatMode()
and setRepeatCount()
have to be set on the Animation
objects, and not on the AnimationSet
object. That's potentially a mistake you may have made.
So either call those methods on the Animation
objects or add those attributes to the XML of the translate
schema.
Another approach is to set an endlessly repeating animation as follows:
mAnimationSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mAnimationSet.start();
}
});
mAnimationSet.start();