From 1a40facbfd60575a3232ae49f4b05098f4ec4830 Mon Sep 17 00:00:00 2001 From: ztenghui Date: Fri, 7 Nov 2014 11:49:45 -0800 Subject: [PATCH] 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 --- .../graphics/drawable/AnimatedVectorDrawable.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java index e65dbaf077b64..d0edebaf40674 100644 --- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java @@ -435,13 +435,16 @@ 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 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(); - } + animator.start(); } invalidateSelf(); }