From c754a217b9725e4cd9399164cdf8ea0ed10f0c73 Mon Sep 17 00:00:00 2001 From: Charlie Anderson Date: Tue, 20 Jan 2026 14:29:28 -0500 Subject: [PATCH] Fix folder view sticking during close anim when transitioning launcher page and/or state Bug: 470662985 Test: manual Flag: EXEMPT BUGFIX Change-Id: I7a4841ad49cbc0339f6905869a1bb092e7f0c094 --- src/com/android/launcher3/Workspace.java | 6 +++++- src/com/android/launcher3/folder/Folder.java | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 1dce62986b..816ea455d8 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -18,6 +18,7 @@ package com.android.launcher3; +import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER; import static com.android.launcher3.AbstractFloatingView.TYPE_WIDGET_RESIZE_FRAME; import static com.android.launcher3.BubbleTextView.DISPLAY_FOLDER; import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY; @@ -1427,7 +1428,10 @@ public class Workspace extends PagedView protected void onPageBeginTransition() { // Widget resize frame doesn't receive events to close when talkback is enabled. For that // case, close it here. - AbstractFloatingView.closeOpenViews(mLauncher, false, TYPE_WIDGET_RESIZE_FRAME); + // Open folders are already animated closed on first touch outside. If page is swiped after, + // then make sure folder is closed immediately. + AbstractFloatingView.closeOpenViews(mLauncher, false, TYPE_WIDGET_RESIZE_FRAME + | TYPE_FOLDER); super.onPageBeginTransition(); updateChildrenLayersEnabled(); diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 8e45bbcd2d..edec8dc4e2 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -1004,9 +1004,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo @Override protected void handleClose(boolean animate) { - mIsOpen = false; mContent.setCanAnnouncePageDescriptionForFolder(false); - if (!animate && mCurrentAnimator != null && mCurrentAnimator.isRunning()) { mCurrentAnimator.cancel(); } @@ -1040,6 +1038,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo private void animateClosed() { if (mIsAnimatingClosed) { + cancelRunningAnimations(); return; } @@ -1096,6 +1095,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo } private void closeComplete(boolean wasAnimated) { + mIsOpen = false; + // TODO: Clear all active animations. BaseDragLayer parent = (BaseDragLayer) getParent(); if (parent != null) {