Loading graphics/java/android/graphics/drawable/RippleDrawable.java +20 −14 Original line number Diff line number Diff line Loading @@ -156,6 +156,12 @@ public class RippleDrawable extends LayerDrawable { /** Whether bounds are being overridden. */ private boolean mOverrideBounds; /** * Whether hotspots are being cleared. Used to prevent re-entry by * animation finish listeners. */ private boolean mClearingHotspots; /** * Constructor used for drawable inflation. */ Loading Loading @@ -524,6 +530,8 @@ public class RippleDrawable extends LayerDrawable { } private void clearHotspots() { mClearingHotspots = true; final int count = mAnimatingRipplesCount; final Ripple[] ripples = mAnimatingRipples; for (int i = 0; i < count; i++) { Loading @@ -532,11 +540,6 @@ public class RippleDrawable extends LayerDrawable { final Ripple ripple = ripples[i]; ripples[i] = null; ripple.cancel(); // The active ripple may also be animating. Don't cancel it twice. if (mRipple == ripple) { mRipple = null; } } if (mRipple != null) { Loading @@ -549,6 +552,7 @@ public class RippleDrawable extends LayerDrawable { mBackground = null; } mClearingHotspots = false; mAnimatingRipplesCount = 0; invalidateSelf(); } Loading Loading @@ -647,6 +651,7 @@ public class RippleDrawable extends LayerDrawable { * @param ripple the ripple to remove */ void removeRipple(Ripple ripple) { if (!mClearingHotspots) { // Ripple ripple ripple ripple. Ripple ripple. final Ripple[] ripples = mAnimatingRipples; final int count = mAnimatingRipplesCount; Loading @@ -658,6 +663,7 @@ public class RippleDrawable extends LayerDrawable { invalidateSelf(); } } } void removeBackground(RippleBackground background) { if (mBackground == background) { Loading Loading
graphics/java/android/graphics/drawable/RippleDrawable.java +20 −14 Original line number Diff line number Diff line Loading @@ -156,6 +156,12 @@ public class RippleDrawable extends LayerDrawable { /** Whether bounds are being overridden. */ private boolean mOverrideBounds; /** * Whether hotspots are being cleared. Used to prevent re-entry by * animation finish listeners. */ private boolean mClearingHotspots; /** * Constructor used for drawable inflation. */ Loading Loading @@ -524,6 +530,8 @@ public class RippleDrawable extends LayerDrawable { } private void clearHotspots() { mClearingHotspots = true; final int count = mAnimatingRipplesCount; final Ripple[] ripples = mAnimatingRipples; for (int i = 0; i < count; i++) { Loading @@ -532,11 +540,6 @@ public class RippleDrawable extends LayerDrawable { final Ripple ripple = ripples[i]; ripples[i] = null; ripple.cancel(); // The active ripple may also be animating. Don't cancel it twice. if (mRipple == ripple) { mRipple = null; } } if (mRipple != null) { Loading @@ -549,6 +552,7 @@ public class RippleDrawable extends LayerDrawable { mBackground = null; } mClearingHotspots = false; mAnimatingRipplesCount = 0; invalidateSelf(); } Loading Loading @@ -647,6 +651,7 @@ public class RippleDrawable extends LayerDrawable { * @param ripple the ripple to remove */ void removeRipple(Ripple ripple) { if (!mClearingHotspots) { // Ripple ripple ripple ripple. Ripple ripple. final Ripple[] ripples = mAnimatingRipples; final int count = mAnimatingRipplesCount; Loading @@ -658,6 +663,7 @@ public class RippleDrawable extends LayerDrawable { invalidateSelf(); } } } void removeBackground(RippleBackground background) { if (mBackground == background) { Loading