summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2015-05-14 15:12:23 -0700
committerDoris Liu <tianliu@google.com>2015-05-14 17:23:43 -0700
commitc7741d467b37351ab13f75592fc7400d0c2ba6d7 (patch)
treeb23667632355b9cc5a9f4c4fe64298cc4b9be49e
parent07b83f1c9e8a7692a985aa2d13ac13fc5521aa4b (diff)
downloadframeworks_base-c7741d467b37351ab13f75592fc7400d0c2ba6d7.zip
frameworks_base-c7741d467b37351ab13f75592fc7400d0c2ba6d7.tar.gz
frameworks_base-c7741d467b37351ab13f75592fc7400d0c2ba6d7.tar.bz2
Start AnimationDrawable from the zeroth frame.
This CL fixes the issue where when start is called, we run the next frame of the animation drawable while mCurFrame is already set to 0. The result is that the first frame of the AnimationDrawable is then skipped. Bug: 21168854 Change-Id: I2b77ae017d3debd0f8cfec81ea86d1120e78bb55
-rw-r--r--graphics/java/android/graphics/drawable/AnimationDrawable.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index 871715e..e1975c9 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -151,7 +151,9 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
mAnimating = true;
if (!isRunning()) {
- run();
+ // Start from 0th frame.
+ setFrame(0, false, mAnimationState.getChildCount() > 1
+ || !mAnimationState.mOneShot);
}
}