From e543818bb61246f5eae3159104134b193431ec85 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 20 May 2019 10:01:15 -0700 Subject: Fix bug where FolderIcon stays visible during swipe up to home animation. This can happen when opening an app from a folder, and then immediately swiping up back to home. This happens because when we swipe up to go home, there's a race condition where the folder close animation finishes and sets the FolderIcon to VISIBLE right before FloatingIconView sets it to INVISIBLE. To fix it, in OverviewState#onStateEnabled we call AbstractFloatingView#closeAllOpenViews(animate=false). Then we added logic to cancel any Folder closing animation (which there is, from WindowTransformSwipeHandler#onLauncherStart) and to just close the folder right then and there. Bug: 132588097 Change-Id: I4379431815e7cbddede5ea0213fe9323f001484b --- .../android/launcher3/uioverrides/states/BackgroundAppState.java | 8 ++++++++ src/com/android/launcher3/folder/Folder.java | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index f429ce5b0..a662d7433 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides.states; import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; +import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Launcher; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.userevent.nano.LauncherLogProto; @@ -41,6 +42,13 @@ public class BackgroundAppState extends OverviewState { super(id, logContainer, OVERVIEW_TRANSITION_MS, STATE_FLAGS); } + @Override + public void onStateEnabled(Launcher launcher) { + RecentsView rv = launcher.getOverviewPanel(); + rv.setOverviewStateEnabled(true); + AbstractFloatingView.closeAllOpenViews(launcher, false); + } + @Override public float getVerticalProgress(Launcher launcher) { if (launcher.getDeviceProfile().isVerticalBarLayout()) { diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 389e85269..2ef6d707e 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -593,6 +593,10 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo protected void handleClose(boolean animate) { mIsOpen = false; + if (!animate && mCurrentAnimator != null && mCurrentAnimator.isRunning()) { + mCurrentAnimator.cancel(); + } + if (isEditingName()) { mFolderName.dispatchBackKey(); } -- cgit v1.2.3