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

Commit ad960239 authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Use DecelerateInterpolator for vertical and horizontal movements

Bug: 259429314
Test: Manual, i.e. testing vertical movement during cross-task back on device
Change-Id: I557f2b5d5efc5b5e1072ef8d836546c0ee192d03
parent 27726bf9
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);