summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--graphics/java/android/graphics/drawable/RippleComponent.java2
-rw-r--r--graphics/java/android/graphics/drawable/RippleDrawable.java19
2 files changed, 14 insertions, 7 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleComponent.java b/graphics/java/android/graphics/drawable/RippleComponent.java
index 5ba2f93..aa2aa20 100644
--- a/graphics/java/android/graphics/drawable/RippleComponent.java
+++ b/graphics/java/android/graphics/drawable/RippleComponent.java
@@ -237,7 +237,7 @@ abstract class RippleComponent {
}
protected final void invalidateSelf() {
- mOwner.invalidateSelf();
+ mOwner.invalidateSelf(false);
}
protected final boolean isHardwareAnimating() {
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java
index f7e8ed0..1af48ca 100644
--- a/graphics/java/android/graphics/drawable/RippleDrawable.java
+++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -229,7 +229,7 @@ public class RippleDrawable extends LayerDrawable {
mExitingRipplesCount = 0;
// Always draw an additional "clean" frame after canceling animations.
- invalidateSelf();
+ invalidateSelf(false);
}
@Override
@@ -364,7 +364,7 @@ public class RippleDrawable extends LayerDrawable {
*/
public void setColor(ColorStateList color) {
mState.mColor = color;
- invalidateSelf();
+ invalidateSelf(false);
}
/**
@@ -376,7 +376,7 @@ public class RippleDrawable extends LayerDrawable {
*/
public void setRadius(int radius) {
mState.mMaxRadius = radius;
- invalidateSelf();
+ invalidateSelf(false);
}
/**
@@ -477,7 +477,7 @@ public class RippleDrawable extends LayerDrawable {
private void setTargetDensity(DisplayMetrics metrics) {
if (mDensity != metrics.density) {
mDensity = metrics.density;
- invalidateSelf();
+ invalidateSelf(false);
}
}
@@ -684,10 +684,17 @@ public class RippleDrawable extends LayerDrawable {
@Override
public void invalidateSelf() {
+ invalidateSelf(true);
+ }
+
+ void invalidateSelf(boolean invalidateMask) {
super.invalidateSelf();
- // Force the mask to update on the next draw().
- mHasValidMask = false;
+ if (invalidateMask) {
+ // Force the mask to update on the next draw().
+ mHasValidMask = false;
+ }
+
}
private void pruneRipples() {