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

Commit 5818f9b3 authored by Tony's avatar Tony
Browse files

Fix overshoot velocity in 2-button landscape mode

Now we use the velocity towards the middle of the screen
(e.g. x when in landscape) instead of always using y.

Test: testBackground with @PortraitLandscape

Bug: 135567630
Change-Id: I77ab6bdf0d556475a6c182ae91914a718a81e1c4
parent ddf64806
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -976,7 +976,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
            if (Math.abs(endVelocity) > minFlingVelocity && mTransitionDragLength > 0) {
                if (endTarget == RECENTS && mMode != Mode.NO_BUTTON) {
                    Interpolators.OvershootParams overshoot = new Interpolators.OvershootParams(
                            startShift, endShift, endShift, velocityPxPerMs.y,
                            startShift, endShift, endShift, endVelocity / 1000,
                            mTransitionDragLength);
                    endShift = overshoot.end;
                    interpolator = overshoot.interpolator;
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.quickstep;

import static com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -208,7 +207,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {

    @Test
    @NavigationModeSwitch
//    @PortraitLandscape
    @PortraitLandscape
    public void testBackground() throws Exception {
        startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
        final Background background = mLauncher.getBackground();
+2 −1
Original line number Diff line number Diff line
@@ -144,7 +144,8 @@ public class Interpolators {
    public static Interpolator clampToProgress(Interpolator interpolator, float lowerBound,
            float upperBound) {
        if (upperBound <= lowerBound) {
            throw new IllegalArgumentException("lowerBound must be less than upperBound");
            throw new IllegalArgumentException(String.format(
                    "lowerBound (%f) must be less than upperBound (%f)", lowerBound, upperBound));
        }
        return t -> {
            if (t < lowerBound) {