Loading graphics/java/android/graphics/drawable/RippleDrawable.java +4 −2 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ public class RippleDrawable extends LayerDrawable { setRippleActive(focused || (enabled && pressed)); setBackgroundActive(hovered || focused || (enabled && pressed), focused || hovered); setBackgroundActive(hovered, hovered); return changed; } Loading Loading @@ -694,7 +694,9 @@ public class RippleDrawable extends LayerDrawable { // have a mask or content and the ripple bounds if we're projecting. final Rect bounds = getDirtyBounds(); final int saveCount = canvas.save(Canvas.CLIP_SAVE_FLAG); if (isBounded()) { canvas.clipRect(bounds); } drawContent(canvas); drawBackgroundAndRipples(canvas); Loading graphics/java/android/graphics/drawable/RippleForeground.java +6 −33 Original line number Diff line number Diff line Loading @@ -80,9 +80,6 @@ class RippleForeground extends RippleComponent { private float mTweenX = 0; private float mTweenY = 0; /** Whether this ripple is bounded. */ private boolean mIsBounded; /** Whether this ripple has finished its exit animation. */ private boolean mHasFinishedExit; Loading @@ -90,7 +87,6 @@ class RippleForeground extends RippleComponent { boolean isBounded, boolean forceSoftware) { super(owner, bounds, forceSoftware); mIsBounded = isBounded; mStartingX = startingX; mStartingY = startingY; Loading Loading @@ -210,31 +206,15 @@ class RippleForeground extends RippleComponent { return (int) (1000 * mOpacity / WAVE_OPACITY_DECAY_VELOCITY + 0.5f); } /** * Compute target values that are dependent on bounding. */ private void computeBoundedTargetValues() { mTargetX = (mClampedStartingX - mBounds.exactCenterX()) * .7f; mTargetY = (mClampedStartingY - mBounds.exactCenterY()) * .7f; mTargetRadius = mBoundedRadius; } @Override protected Animator createSoftwareExit() { final int radiusDuration; final int originDuration; final int opacityDuration; if (mIsBounded) { computeBoundedTargetValues(); radiusDuration = BOUNDED_RADIUS_EXIT_DURATION; originDuration = BOUNDED_ORIGIN_EXIT_DURATION; opacityDuration = BOUNDED_OPACITY_EXIT_DURATION; } else { radiusDuration = getRadiusExitDuration(); originDuration = radiusDuration; opacityDuration = getOpacityExitDuration(); } final ObjectAnimator tweenRadius = ObjectAnimator.ofFloat(this, TWEEN_RADIUS, 1); tweenRadius.setAutoCancel(true); Loading Loading @@ -263,17 +243,10 @@ class RippleForeground extends RippleComponent { final int radiusDuration; final int originDuration; final int opacityDuration; if (mIsBounded) { computeBoundedTargetValues(); radiusDuration = BOUNDED_RADIUS_EXIT_DURATION; originDuration = BOUNDED_ORIGIN_EXIT_DURATION; opacityDuration = BOUNDED_OPACITY_EXIT_DURATION; } else { radiusDuration = getRadiusExitDuration(); originDuration = radiusDuration; opacityDuration = getOpacityExitDuration(); } final float startX = getCurrentX(); final float startY = getCurrentY(); Loading Loading
graphics/java/android/graphics/drawable/RippleDrawable.java +4 −2 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ public class RippleDrawable extends LayerDrawable { setRippleActive(focused || (enabled && pressed)); setBackgroundActive(hovered || focused || (enabled && pressed), focused || hovered); setBackgroundActive(hovered, hovered); return changed; } Loading Loading @@ -694,7 +694,9 @@ public class RippleDrawable extends LayerDrawable { // have a mask or content and the ripple bounds if we're projecting. final Rect bounds = getDirtyBounds(); final int saveCount = canvas.save(Canvas.CLIP_SAVE_FLAG); if (isBounded()) { canvas.clipRect(bounds); } drawContent(canvas); drawBackgroundAndRipples(canvas); Loading
graphics/java/android/graphics/drawable/RippleForeground.java +6 −33 Original line number Diff line number Diff line Loading @@ -80,9 +80,6 @@ class RippleForeground extends RippleComponent { private float mTweenX = 0; private float mTweenY = 0; /** Whether this ripple is bounded. */ private boolean mIsBounded; /** Whether this ripple has finished its exit animation. */ private boolean mHasFinishedExit; Loading @@ -90,7 +87,6 @@ class RippleForeground extends RippleComponent { boolean isBounded, boolean forceSoftware) { super(owner, bounds, forceSoftware); mIsBounded = isBounded; mStartingX = startingX; mStartingY = startingY; Loading Loading @@ -210,31 +206,15 @@ class RippleForeground extends RippleComponent { return (int) (1000 * mOpacity / WAVE_OPACITY_DECAY_VELOCITY + 0.5f); } /** * Compute target values that are dependent on bounding. */ private void computeBoundedTargetValues() { mTargetX = (mClampedStartingX - mBounds.exactCenterX()) * .7f; mTargetY = (mClampedStartingY - mBounds.exactCenterY()) * .7f; mTargetRadius = mBoundedRadius; } @Override protected Animator createSoftwareExit() { final int radiusDuration; final int originDuration; final int opacityDuration; if (mIsBounded) { computeBoundedTargetValues(); radiusDuration = BOUNDED_RADIUS_EXIT_DURATION; originDuration = BOUNDED_ORIGIN_EXIT_DURATION; opacityDuration = BOUNDED_OPACITY_EXIT_DURATION; } else { radiusDuration = getRadiusExitDuration(); originDuration = radiusDuration; opacityDuration = getOpacityExitDuration(); } final ObjectAnimator tweenRadius = ObjectAnimator.ofFloat(this, TWEEN_RADIUS, 1); tweenRadius.setAutoCancel(true); Loading Loading @@ -263,17 +243,10 @@ class RippleForeground extends RippleComponent { final int radiusDuration; final int originDuration; final int opacityDuration; if (mIsBounded) { computeBoundedTargetValues(); radiusDuration = BOUNDED_RADIUS_EXIT_DURATION; originDuration = BOUNDED_ORIGIN_EXIT_DURATION; opacityDuration = BOUNDED_OPACITY_EXIT_DURATION; } else { radiusDuration = getRadiusExitDuration(); originDuration = radiusDuration; opacityDuration = getOpacityExitDuration(); } final float startX = getCurrentX(); final float startY = getCurrentY(); Loading