diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-05-31 23:22:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-31 23:22:30 +0000 |
commit | 72c6e7b73651dcb0c3cacd12a284a8f3a42cd436 (patch) | |
tree | 7bd42ab2a947685f929ada93d179800e2d5492dc /quickstep/recents_ui_overrides/src | |
parent | 061c43eb4fb9fd0af68ce270a6042642607ac855 (diff) | |
parent | a04e746e84f918fd5e6d4fa2cda7b60d90462cf0 (diff) | |
download | android_packages_apps_Trebuchet-72c6e7b73651dcb0c3cacd12a284a8f3a42cd436.tar.gz android_packages_apps_Trebuchet-72c6e7b73651dcb0c3cacd12a284a8f3a42cd436.tar.bz2 android_packages_apps_Trebuchet-72c6e7b73651dcb0c3cacd12a284a8f3a42cd436.zip |
Merge "Fix getting stuck in BackgroundAppState for 2-button mode" into ub-launcher3-qt-dev
Diffstat (limited to 'quickstep/recents_ui_overrides/src')
3 files changed, 18 insertions, 16 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java index f12efc83c..dc58a4efc 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java @@ -70,7 +70,7 @@ public final class FallbackActivityControllerHelper implements } @Override - public void onSwipeUpComplete(RecentsActivity activity) { + public void onSwipeUpToRecentsComplete(RecentsActivity activity) { RecentsView recentsView = activity.getOverviewPanel(); recentsView.getClearAllButton().setVisibilityAlpha(1); recentsView.setDisallowScrollToClearAll(false); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index 5af09f7fd..d0a41f3b5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -91,7 +91,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe } @Override - public void onSwipeUpComplete(Launcher activity) { + public void onSwipeUpToRecentsComplete(Launcher activity) { // Re apply state in case we did something funky during the transition. activity.getStateManager().reapplyState(); DiscoveryBounce.showForOverviewIfNeeded(activity); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index c7aaa9bb2..87b732664 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -353,7 +353,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> | STATE_LAUNCHER_DRAWN | STATE_SCALED_CONTROLLER_RECENTS | STATE_CURRENT_TASK_FINISHED | STATE_GESTURE_COMPLETED | STATE_GESTURE_STARTED, - this::setupLauncherUiAfterSwipeUpAnimation); + this::setupLauncherUiAfterSwipeUpToRecentsAnimation); mStateCallback.addCallback(STATE_HANDLER_INVALIDATED, this::invalidateHandler); mStateCallback.addCallback(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED, @@ -647,7 +647,10 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> } private void buildAnimationController() { - if (mStateCallback.hasStates(STATE_GESTURE_COMPLETED)) { + if (mGestureEndTarget == HOME || (mLauncherTransitionController != null + && mLauncherTransitionController.getAnimationPlayer().isStarted())) { + // We don't want a new mLauncherTransitionController if mGestureEndTarget == HOME (it + // has its own animation) or if we're already animating the current controller. return; } initTransitionEndpoints(mActivity.getDeviceProfile()); @@ -1276,12 +1279,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> } private void invalidateHandlerWithLauncher() { - if (mLauncherTransitionController != null) { - if (mLauncherTransitionController.getAnimationPlayer().isStarted()) { - mLauncherTransitionController.getAnimationPlayer().cancel(); - } - mLauncherTransitionController = null; - } + endLauncherTransitionController(); mRecentsView.onGestureAnimationEnd(); @@ -1289,6 +1287,13 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> mActivity.getRootView().getOverlay().remove(mLiveTileOverlay); } + private void endLauncherTransitionController() { + if (mLauncherTransitionController != null) { + mLauncherTransitionController.getAnimationPlayer().end(); + mLauncherTransitionController = null; + } + } + private void notifyTransitionCancelled() { mAnimationFactory.onTransitionCancelled(); } @@ -1390,12 +1395,9 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> doLogGesture(HOME); } - private void setupLauncherUiAfterSwipeUpAnimation() { - if (mLauncherTransitionController != null) { - mLauncherTransitionController.getAnimationPlayer().end(); - mLauncherTransitionController = null; - } - mActivityControlHelper.onSwipeUpComplete(mActivity); + private void setupLauncherUiAfterSwipeUpToRecentsAnimation() { + endLauncherTransitionController(); + mActivityControlHelper.onSwipeUpToRecentsComplete(mActivity); mRecentsAnimationWrapper.setCancelWithDeferredScreenshot(true); mRecentsView.onSwipeUpAnimationSuccess(); |