Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a40facb authored by ztenghui's avatar ztenghui
Browse files

AVD: Requires all animator has stopped before start again.

We should treat all the animator as a group, we should not start again unless
all the previous animations have stopped.

b/18320770

Change-Id: I5b0c2c165cd314745ee6c7152aea3c666e9dff10
parent f4d2c8ee
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -435,14 +435,17 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {

    @Override
    public void start() {
        // If any one of the animator has not ended, do nothing.
        if (isStarted()) {
            return;
        }
        // Otherwise, kick off every animator.
        final ArrayList<Animator> animators = mAnimatedVectorState.mAnimators;
        final int size = animators.size();
        for (int i = 0; i < size; i++) {
            final Animator animator = animators.get(i);
            if (!animator.isStarted()) {
            animator.start();
        }
        }
        invalidateSelf();
    }