Repeat AnimatorSet

后端 未结 7 1595
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 09:19

Is there a simple way to repeat a Android AnimatorSet (infinite)? Can I set a AnimationListener and restart the AnimatorSet by calling

7条回答
  •  梦如初夏
    2021-02-05 09:55

    How about this?

    @Override
    public void onAnimationEnd(Animator animation) {
        if (!mCanceled) {
            animation.reset();  //<- added.
            animation.start();
        }
    }
    

提交回复
热议问题