From 8f45458925b7c3c6a4034cf6dc64cc046b1dbad3 Mon Sep 17 00:00:00 2001 From: Shan Huang Date: Mon, 25 Apr 2022 23:50:19 +0000 Subject: [PATCH] Close icon folder for predictive back to home animation. Folders are typically closed in launcher#onResume. However in the predictive back flow, launcher isn't resumed until transition fully goes through. Therefore we need to explicitly close the folders on transition start. Bug: 229861300 Test: Open an opted in app from workspace folder and swipe back (with animations enabled). Change-Id: I4b5229cd2590c164ffba892f49eeb2e26438eadf --- .../android/quickstep/LauncherBackAnimationController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java index dc65b503c2..fd9f922005 100644 --- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java +++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java @@ -16,6 +16,7 @@ package com.android.quickstep; +import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.launcher3.BaseActivity.INVISIBLE_ALL; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS; import static com.android.launcher3.BaseActivity.PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION; @@ -37,6 +38,7 @@ import android.view.animation.Interpolator; import android.window.BackEvent; import android.window.IOnBackInvokedCallback; +import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseQuickstepLauncher; import com.android.launcher3.QuickstepTransitionManager; import com.android.launcher3.R; @@ -274,6 +276,10 @@ public class LauncherBackAnimationController { mLauncher.getStateManager().moveToRestState(); } + // Explicitly close opened floating views (which is typically called from + // Launcher#onResumed, but in the predictive back flow launcher is not resumed until + // the transition is fully finished.) + AbstractFloatingView.closeAllOpenViewsExcept(mLauncher, false, TYPE_REBIND_SAFE); float cornerRadius = Utilities.mapRange( mBackProgress, mWindowScaleStartCornerRadius, mWindowScaleEndCornerRadius); Pair pair =