Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a302542 authored by Tenghui Zhu's avatar Tenghui Zhu Committed by Android (Google) Code Review
Browse files

Merge "Trigger circular ripple when touched down, instead of up."

parents ed0665f3 5cfb3d7e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ class RippleBackground extends RippleComponent {
        final AnimatorSet set = new AnimatorSet();

        // Linear exit after enter is completed.
        final ObjectAnimator exit = ObjectAnimator.ofFloat(this, RippleBackground.OPACITY, 0);
        final ObjectAnimator exit = ObjectAnimator.ofFloat(this, OPACITY, 0);
        exit.setInterpolator(LINEAR_INTERPOLATOR);
        exit.setDuration(OPACITY_EXIT_DURATION);
        exit.setAutoCancel(true);
@@ -115,7 +115,7 @@ class RippleBackground extends RippleComponent {
        final int fastEnterDuration = mIsBounded ?
                (int) ((1 - mOpacity) * OPACITY_ENTER_DURATION_FAST) : 0;
        if (fastEnterDuration > 0) {
            final ObjectAnimator enter = ObjectAnimator.ofFloat(this, RippleBackground.OPACITY, 1);
            final ObjectAnimator enter = ObjectAnimator.ofFloat(this, OPACITY, 1);
            enter.setInterpolator(LINEAR_INTERPOLATOR);
            enter.setDuration(fastEnterDuration);
            enter.setAutoCancel(true);
+2 −1
Original line number Diff line number Diff line
@@ -266,7 +266,8 @@ public class RippleDrawable extends LayerDrawable {
            }
        }

        setRippleActive(enabled && pressed);
        setRippleActive(focused || (enabled && pressed));

        setBackgroundActive(hovered || focused || (enabled && pressed), focused || hovered);

        return changed;
+0 −5
Original line number Diff line number Diff line
@@ -162,11 +162,6 @@ class RippleForeground extends RippleComponent {

    @Override
    protected Animator createSoftwareEnter(boolean fast) {
        // Bounded ripples don't have enter animations.
        if (mIsBounded) {
            return null;
        }

        final int duration = (int)
                (1000 * Math.sqrt(mTargetRadius / WAVE_TOUCH_DOWN_ACCELERATION * mDensityScale) + 0.5);