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

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

Use STANDARD_DECELERATE interpolator for predictive back to home

Bug: 325647546
Flag: ACONFIG com.android.systemui.predictive_back_system_animations TEAMFOOD
Test: Manual, i.e. verifying increased responsiveness during first phase of back gesture
Change-Id: Ie31d7fba7ca307c96830e0656887cda89d9bbb1a
parent 51c09ed1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.window.BackMotionEvent;
import android.window.BackProgressAnimator;
import android.window.IOnBackInvokedCallback;

import com.android.app.animation.Interpolators;
import com.android.internal.view.AppearanceRegion;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
@@ -103,7 +104,8 @@ public class LauncherBackAnimationController {
    private float mWindowScaleEndCornerRadius;
    private float mWindowScaleStartCornerRadius;
    private final Interpolator mCancelInterpolator;
    private final Interpolator mProgressInterpolator = new DecelerateInterpolator();
    private final Interpolator mProgressInterpolator = Interpolators.STANDARD_DECELERATE;
    private final Interpolator mVerticalMoveInterpolator = new DecelerateInterpolator();
    private final PointF mInitialTouchPos = new PointF();

    private RemoteAnimationTarget mBackTarget;
@@ -376,7 +378,7 @@ public class LauncherBackAnimationController {
        float yDirection = rawYDelta < 0 ? -1 : 1;
        // limit yDelta interpretation to 1/2 of screen height in either direction
        float deltaYRatio = Math.min(screenHeight / 2f, Math.abs(rawYDelta)) / (screenHeight / 2f);
        float interpolatedYRatio = mProgressInterpolator.getInterpolation(deltaYRatio);
        float interpolatedYRatio = mVerticalMoveInterpolator.getInterpolation(deltaYRatio);
        // limit y-shift so surface never passes 8dp screen margin
        float deltaY = yDirection * interpolatedYRatio * Math.max(0f, (screenHeight - height)
                / 2f - mWindowScaleMarginX);