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) {