From a04c779f86692d1b2da095af41c279a5d841e664 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 7 Jun 2018 10:45:31 -0700 Subject: [PATCH] Reset the UI to the proper state, if we start the swipe-ui gesture from an inconsistent state Bug: 109583168 Change-Id: I451c66bf7643b7c1791c26b5862ca9f7a020f7be --- .../launcher3/LauncherAppTransitionManagerImpl.java | 1 + .../com/android/quickstep/ActivityControlHelper.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index 114f96a6ec..4c90cbeb01 100644 --- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -672,6 +672,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag if (mLauncher.hasSomeInvisibleFlag(PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION)) { mLauncher.addForceInvisibleFlag(INVISIBLE_BY_PENDING_FLAGS); + mLauncher.getStateManager().moveToRestState(); } AnimatorSet anim = null; diff --git a/quickstep/src/com/android/quickstep/ActivityControlHelper.java b/quickstep/src/com/android/quickstep/ActivityControlHelper.java index 0205c1f032..f1aff05c26 100644 --- a/quickstep/src/com/android/quickstep/ActivityControlHelper.java +++ b/quickstep/src/com/android/quickstep/ActivityControlHelper.java @@ -16,6 +16,7 @@ package com.android.quickstep; import static android.view.View.TRANSLATION_Y; + import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherState.FAST_OVERVIEW; @@ -52,6 +53,7 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.DiscoveryBounce; +import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.uioverrides.FastOverviewState; @@ -265,6 +267,14 @@ public interface ActivityControlHelper { controller, ALL_APPS_PROGRESS, startProgress, endProgress); shiftAnim.setInterpolator(LINEAR); anim.play(shiftAnim); + + // Since we are changing the start position of the UI, reapply the state, at the end + anim.addListener(new AnimationSuccessListener() { + @Override + public void onAnimationSuccess(Animator animator) { + activity.getStateManager().reapplyState(); + } + }); } if (interactionType == INTERACTION_NORMAL) {