From dd2bea9e706402daeb5c83d36894897c75022a01 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Wed, 9 Mar 2022 14:39:49 -0800 Subject: [PATCH] Fix wrong initial staged split position This is caused by having set a wrong animation duration in the 3 button case. Before this change we have a fixed duration of 370ms which happens to be almost match the Overview transtion duration in gesture nav. However the transition duration in 3-button is set to 250ms. After the transition duration, any unfinished animation is cancelled including this one, resulting in the wrong staged split position. Instead this change pulls the transition duration of toState from the caller = RecentsViewStateController. Fixes: 222210349 Test: manual Change-Id: Ie2f3dbe38bb6df33961e2ee78b8a55d0e925501f --- .../launcher3/uioverrides/RecentsViewStateController.java | 4 ++-- .../quickstep/fallback/FallbackRecentsStateController.java | 3 ++- quickstep/src/com/android/quickstep/views/RecentsView.java | 7 ++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index 32ce1c40d7..947d3e26da 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -118,8 +118,8 @@ public final class RecentsViewStateController extends if (isSplitSelectionState(currentState, toState)) { // Animation to "dismiss" selected taskView - PendingAnimation splitSelectInitAnimation = - mRecentsView.createSplitSelectInitAnimation(); + PendingAnimation splitSelectInitAnimation = mRecentsView.createSplitSelectInitAnimation( + toState.getTransitionDuration(mLauncher)); // Add properties to shift remaining taskViews to get out of placeholder view splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.first, toState.getSplitSelectTranslation(mLauncher), LINEAR); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index ff175f18f2..5094d49200 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -111,7 +111,8 @@ public class FallbackRecentsStateController implements StateHandler taskViewsFloat = diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 5e331e2e86..c13e269180 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -28,7 +28,6 @@ import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRES import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION; -import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURATION; import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.Utilities.mapToRange; import static com.android.launcher3.Utilities.squaredHypot; @@ -3987,14 +3986,12 @@ public abstract class RecentsView