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

Commit a7066cb6 authored by Alex Chau's avatar Alex Chau
Browse files

Use same interpolator for fullscreen scale and translation

Fixes: 187690450
Test: Swipe up from quick switch, tasks should not overlap
Change-Id: Ib2596d982974b7a1a9acbb02026e8d920e7fea25
parent 5160385a
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.Utilities.comp;
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.EXAGGERATED_EASE;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS;
@@ -65,6 +64,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
import android.widget.Toast;

@@ -147,6 +147,9 @@ public class TaskView extends FrameLayout implements Reusable {

    public static final long SCALE_ICON_DURATION = 120;
    private static final long DIM_ANIM_DURATION = 700;

    private static final Interpolator FULLSCREEN_INTERPOLATOR = ACCEL_DEACCEL;

    /**
     * This technically can be a vanilla {@link TouchDelegate} class, however that class requires
     * setting the touch bounds at construction, so we'd repeatedly be created many instances
@@ -982,7 +985,7 @@ public class TaskView extends FrameLayout implements Reusable {

    private void applyScale() {
        float scale = 1;
        float fullScreenProgress = EXAGGERATED_EASE.getInterpolation(mFullscreenProgress);
        float fullScreenProgress = FULLSCREEN_INTERPOLATOR.getInterpolation(mFullscreenProgress);
        scale *= Utilities.mapRange(fullScreenProgress, 1f, mFullscreenScale);
        setScaleX(scale);
        setScaleY(scale);
@@ -1425,7 +1428,7 @@ public class TaskView extends FrameLayout implements Reusable {
    }

    private float getFullscreenTrans(float endTranslation) {
        float progress = ACCEL_DEACCEL.getInterpolation(mFullscreenProgress);
        float progress = FULLSCREEN_INTERPOLATOR.getInterpolation(mFullscreenProgress);
        return Utilities.mapRange(progress, 0, endTranslation);
    }