summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-09-26 23:19:32 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-26 23:19:32 +0000
commitcde6e29ac64d274c27e06a5e36c21966065edd00 (patch)
treeb148d660fdec14a27ddd9a24b0baabbd6f212211 /graphics
parent803d3fc394e450a24bdea08050c63937b34a9032 (diff)
parentab9f1bab6b9513a7b722be989b78d5a41514b181 (diff)
downloadframeworks_base-cde6e29ac64d274c27e06a5e36c21966065edd00.zip
frameworks_base-cde6e29ac64d274c27e06a5e36c21966065edd00.tar.gz
frameworks_base-cde6e29ac64d274c27e06a5e36c21966065edd00.tar.bz2
am 63756956: Merge "Add callback to track and thumb drawables, propagate state in ASLD" into lmp-dev
* commit '637569566d2234b06e08d94acf4db1b0d3be6501': Add callback to track and thumb drawables, propagate state in ASLD
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java b/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java
index f7584d8..d78138bc 100644
--- a/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java
@@ -91,7 +91,8 @@ public class AnimatedStateListDrawable extends StateListDrawable {
if (visible) {
mTransition.start();
} else {
- mTransition.stop();
+ // Ensure we're showing the correct state when visible.
+ jumpToCurrentState();
}
}
@@ -140,7 +141,11 @@ public class AnimatedStateListDrawable extends StateListDrawable {
protected boolean onStateChange(int[] stateSet) {
final int keyframeIndex = mState.indexOfKeyframe(stateSet);
if (keyframeIndex == getCurrentIndex()) {
- // No transition needed.
+ // Propagate state change to current keyframe.
+ final Drawable current = getCurrent();
+ if (current != null) {
+ return current.setState(stateSet);
+ }
return false;
}