Loading graphics/java/android/graphics/drawable/RippleBackground.java +4 −17 Original line number Diff line number Diff line Loading @@ -107,9 +107,6 @@ class RippleBackground { /** Whether we have an explicit maximum radius. */ private boolean mHasMaxRadius; /** Whether we were canceled externally and should avoid self-removal. */ private boolean mCanceled; /** * Creates a new ripple. */ Loading Loading @@ -406,6 +403,9 @@ class RippleBackground { mHardwareAnimating = true; // Set up the software values to match the hardware end values. mOuterOpacity = 0; invalidateSelf(); } Loading @@ -414,10 +414,8 @@ class RippleBackground { * removing the ripple from the list of animating ripples. */ public void jump() { mCanceled = true; endSoftwareAnimations(); endHardwareAnimations(); mCanceled = false; } private void endSoftwareAnimations() { Loading Loading @@ -446,7 +444,6 @@ class RippleBackground { // listener on a pending animation, we also need to remove ourselves. if (!mPendingAnimations.isEmpty()) { mPendingAnimations.clear(); removeSelf(); } mHardwareAnimating = false; Loading Loading @@ -526,10 +523,8 @@ class RippleBackground { * the ripple from the list of animating ripples. */ public void cancel() { mCanceled = true; cancelSoftwareAnimations(); cancelHardwareAnimations(true); mCanceled = false; } private void cancelSoftwareAnimations() { Loading @@ -555,7 +550,6 @@ class RippleBackground { for (int i = 0; i < N; i++) { runningAnimations.get(i).cancel(); } runningAnimations.clear(); if (cancelPending && !mPendingAnimations.isEmpty()) { Loading @@ -565,13 +559,6 @@ class RippleBackground { mHardwareAnimating = false; } private void removeSelf() { // The owner will invalidate itself. if (!mCanceled) { mOwner.removeBackground(this); } } private void invalidateSelf() { mOwner.invalidateSelf(); } Loading @@ -579,7 +566,7 @@ class RippleBackground { private final AnimatorListenerAdapter mAnimationListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { removeSelf(); mHardwareAnimating = false; } }; Loading graphics/java/android/graphics/drawable/RippleDrawable.java +1 −9 Original line number Diff line number Diff line Loading @@ -628,11 +628,10 @@ public class RippleDrawable extends LayerDrawable { @Override public void draw(@NonNull Canvas canvas) { final boolean isProjected = isProjected(); final boolean hasMask = mMask != null; final boolean drawNonMaskContent = mLayerState.mNum > (hasMask ? 1 : 0); final boolean drawMask = hasMask && mMask.getOpacity() != PixelFormat.OPAQUE; final Rect bounds = isProjected ? getDirtyBounds() : getBounds(); final Rect bounds = getDirtyBounds(); // If we have content, draw it into a layer first. final int contentLayer = drawNonMaskContent ? Loading Loading @@ -685,13 +684,6 @@ public class RippleDrawable extends LayerDrawable { } } void removeBackground(RippleBackground background) { if (mBackground == background) { mBackground = null; invalidateSelf(); } } private int getRippleIndex(Ripple ripple) { final Ripple[] ripples = mExitingRipples; final int count = mExitingRipplesCount; Loading Loading
graphics/java/android/graphics/drawable/RippleBackground.java +4 −17 Original line number Diff line number Diff line Loading @@ -107,9 +107,6 @@ class RippleBackground { /** Whether we have an explicit maximum radius. */ private boolean mHasMaxRadius; /** Whether we were canceled externally and should avoid self-removal. */ private boolean mCanceled; /** * Creates a new ripple. */ Loading Loading @@ -406,6 +403,9 @@ class RippleBackground { mHardwareAnimating = true; // Set up the software values to match the hardware end values. mOuterOpacity = 0; invalidateSelf(); } Loading @@ -414,10 +414,8 @@ class RippleBackground { * removing the ripple from the list of animating ripples. */ public void jump() { mCanceled = true; endSoftwareAnimations(); endHardwareAnimations(); mCanceled = false; } private void endSoftwareAnimations() { Loading Loading @@ -446,7 +444,6 @@ class RippleBackground { // listener on a pending animation, we also need to remove ourselves. if (!mPendingAnimations.isEmpty()) { mPendingAnimations.clear(); removeSelf(); } mHardwareAnimating = false; Loading Loading @@ -526,10 +523,8 @@ class RippleBackground { * the ripple from the list of animating ripples. */ public void cancel() { mCanceled = true; cancelSoftwareAnimations(); cancelHardwareAnimations(true); mCanceled = false; } private void cancelSoftwareAnimations() { Loading @@ -555,7 +550,6 @@ class RippleBackground { for (int i = 0; i < N; i++) { runningAnimations.get(i).cancel(); } runningAnimations.clear(); if (cancelPending && !mPendingAnimations.isEmpty()) { Loading @@ -565,13 +559,6 @@ class RippleBackground { mHardwareAnimating = false; } private void removeSelf() { // The owner will invalidate itself. if (!mCanceled) { mOwner.removeBackground(this); } } private void invalidateSelf() { mOwner.invalidateSelf(); } Loading @@ -579,7 +566,7 @@ class RippleBackground { private final AnimatorListenerAdapter mAnimationListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { removeSelf(); mHardwareAnimating = false; } }; Loading
graphics/java/android/graphics/drawable/RippleDrawable.java +1 −9 Original line number Diff line number Diff line Loading @@ -628,11 +628,10 @@ public class RippleDrawable extends LayerDrawable { @Override public void draw(@NonNull Canvas canvas) { final boolean isProjected = isProjected(); final boolean hasMask = mMask != null; final boolean drawNonMaskContent = mLayerState.mNum > (hasMask ? 1 : 0); final boolean drawMask = hasMask && mMask.getOpacity() != PixelFormat.OPAQUE; final Rect bounds = isProjected ? getDirtyBounds() : getBounds(); final Rect bounds = getDirtyBounds(); // If we have content, draw it into a layer first. final int contentLayer = drawNonMaskContent ? Loading Loading @@ -685,13 +684,6 @@ public class RippleDrawable extends LayerDrawable { } } void removeBackground(RippleBackground background) { if (mBackground == background) { mBackground = null; invalidateSelf(); } } private int getRippleIndex(Ripple ripple) { final Ripple[] ripples = mExitingRipples; final int count = mExitingRipplesCount; Loading