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
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 f429ce5..a662d74 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 @@
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;
@@ -42,6 +43,13 @@
}
@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()) {
return super.getVerticalProgress(launcher);
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 389e852..2ef6d70 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -593,6 +593,10 @@
protected void handleClose(boolean animate) {
mIsOpen = false;
+ if (!animate && mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
+ mCurrentAnimator.cancel();
+ }
+
if (isEditingName()) {
mFolderName.dispatchBackKey();
}