From a7066cb6ff99fe037eab8294878f564fd6106bed Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 10 May 2021 15:48:36 +0100 Subject: [PATCH] Use same interpolator for fullscreen scale and translation Fixes: 187690450 Test: Swipe up from quick switch, tasks should not overlap Change-Id: Ib2596d982974b7a1a9acbb02026e8d920e7fea25 --- quickstep/src/com/android/quickstep/views/TaskView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 6f3aade68b..4a07748644 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -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); }