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

Commit 62813f60 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Android (Google) Code Review
Browse files

Merge "Use DecelerateInterpolator for vertical and horizontal movements" into main

parents 71014618 ad960239
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -88,8 +88,6 @@ public class Interpolators {
    public static final PathInterpolator DIM_INTERPOLATOR =
            new PathInterpolator(.23f, .87f, .52f, -0.11f);

    public static final Interpolator DECELERATE = new PathInterpolator(0f, 0f, 0.5f, 1f);

    // Create the default emphasized interpolator
    private static PathInterpolator createEmphasizedInterpolator() {
        Path path = new Path();
+1 −2
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ public class CrossTaskBackAnimation extends ShellBackAnimation {

    private final PointF mInitialTouchPos = new PointF();
    private final Interpolator mPostAnimationInterpolator = Interpolators.EMPHASIZED;
    private final Interpolator mYMovementInterpolator = Interpolators.DECELERATE;
    private final Interpolator mProgressInterpolator = new DecelerateInterpolator();
    private final Matrix mTransformMatrix = new Matrix();

@@ -164,7 +163,7 @@ public class CrossTaskBackAnimation extends ShellBackAnimation {
        float yDirection = rawYDelta < 0 ? -1 : 1;
        // limit yDelta interpretation to 1/2 of screen height in either direction
        float deltaYRatio = Math.min(height / 2f, Math.abs(rawYDelta)) / (height / 2f);
        float interpolatedYRatio = mYMovementInterpolator.getInterpolation(deltaYRatio);
        float interpolatedYRatio = mProgressInterpolator.getInterpolation(deltaYRatio);
        // limit y-shift so surface never passes 8dp screen margin
        float deltaY = yDirection * interpolatedYRatio * Math.max(0f,
                (height - scaledHeight) / 2f - mVerticalMargin);