diff options
author | Chet Haase <chet@google.com> | 2014-08-18 22:03:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-18 21:31:41 +0000 |
commit | 32e966ccb3da268af7b0ecdf5987d10700600473 (patch) | |
tree | eca5214662fc81ccf672ec305cb63e6c96dcdf70 /graphics | |
parent | 71809ee7f63229d0ea4f6169922ddfbfee330fd2 (diff) | |
parent | 030435773dc5413a690d460e97fd681740cd32ef (diff) | |
download | frameworks_base-32e966ccb3da268af7b0ecdf5987d10700600473.zip frameworks_base-32e966ccb3da268af7b0ecdf5987d10700600473.tar.gz frameworks_base-32e966ccb3da268af7b0ecdf5987d10700600473.tar.bz2 |
Merge "Fix crash in AnimationDrawable" into lmp-dev
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/drawable/AnimationDrawable.java | 4 |
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 5318fa7..d87e8e4 100644 --- a/graphics/java/android/graphics/drawable/AnimationDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java @@ -114,7 +114,9 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An final boolean changed = super.setVisible(visible, restart); if (visible) { if (restart || changed) { - setFrame(restart ? 0 : mCurFrame, true, mAnimating); + boolean startFromZero = restart || mCurFrame < 0 || + mCurFrame >= mAnimationState.getChildCount(); + setFrame(startFromZero ? 0 : mCurFrame, true, mAnimating); } } else { unscheduleSelf(this); |