diff options
author | Alan Viverette <alanv@google.com> | 2015-03-18 17:26:54 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-03-18 17:26:54 -0700 |
commit | fc8882f1340055e00f6c21449983e92413045275 (patch) | |
tree | 3e57f2407ae80df7d522b6430fcadd889dfb994a | |
parent | f2560e62cf26cae64f5751b0479743e09cb7bd7f (diff) | |
download | frameworks_base-fc8882f1340055e00f6c21449983e92413045275.zip frameworks_base-fc8882f1340055e00f6c21449983e92413045275.tar.gz frameworks_base-fc8882f1340055e00f6c21449983e92413045275.tar.bz2 |
Clean up ripple exit, null out software animators on cancel/end
Bug: 19682421
Change-Id: I40ff56ed98a6c67cd01c74e455899825013a1f12
-rw-r--r-- | graphics/java/android/graphics/drawable/RippleComponent.java | 2 | ||||
-rw-r--r-- | graphics/java/android/graphics/drawable/RippleDrawable.java | 27 |
2 files changed, 5 insertions, 24 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleComponent.java b/graphics/java/android/graphics/drawable/RippleComponent.java index 7976e82..0412e35 100644 --- a/graphics/java/android/graphics/drawable/RippleComponent.java +++ b/graphics/java/android/graphics/drawable/RippleComponent.java @@ -193,6 +193,7 @@ abstract class RippleComponent { private void cancelSoftwareAnimations() { if (mSoftwareAnimator != null) { mSoftwareAnimator.cancel(); + mSoftwareAnimator = null; } } @@ -203,6 +204,7 @@ abstract class RippleComponent { private void endSoftwareAnimations() { if (mSoftwareAnimator != null) { mSoftwareAnimator.end(); + mSoftwareAnimator = null; } } diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java index 66160c0..23f93fd 100644 --- a/graphics/java/android/graphics/drawable/RippleDrawable.java +++ b/graphics/java/android/graphics/drawable/RippleDrawable.java @@ -212,19 +212,12 @@ public class RippleDrawable extends LayerDrawable { } cancelExitingRipples(); - invalidateSelf(); } - private boolean cancelExitingRipples() { - boolean needsDraw = false; - + private void cancelExitingRipples() { final int count = mExitingRipplesCount; final RippleForeground[] ripples = mExitingRipples; for (int i = 0; i < count; i++) { - // If the ripple is animating on the hardware thread, we'll need to - // draw an additional frame after canceling to restore the software - // drawing path. - needsDraw |= ripples[i].isHardwareAnimating(); ripples[i].end(); } @@ -233,21 +226,8 @@ public class RippleDrawable extends LayerDrawable { } mExitingRipplesCount = 0; - return needsDraw; - } - - @Override - public void setAlpha(int alpha) { - super.setAlpha(alpha); - - // TODO: Should we support this? - } - - @Override - public void setColorFilter(ColorFilter colorFilter) { - super.setColorFilter(colorFilter); - - // TODO: Should we support this? + // Always draw an additional "clean" frame after canceling animations. + invalidateSelf(); } @Override @@ -606,7 +586,6 @@ public class RippleDrawable extends LayerDrawable { } cancelExitingRipples(); - invalidateSelf(); } @Override |