From ce03c9972bba8399fe8b1c671bf2a3a6bf785fca Mon Sep 17 00:00:00 2001 From: Luca Zuccarini Date: Mon, 5 Sep 2022 15:09:52 +0000 Subject: [PATCH] Fix issue with keyboard disappearing too late. This seems to have been caused by a bad merge which removed the call from outside the end listener. We reintroduce it for atomic animations only, as for manual ones we want the keyboard to animate in sync with All Apps (note that this is how it used to be, and doesn't depend on the keyboard sync flag). Fixes: 243632287 Fixes: 240116666 Test: manual Change-Id: I9d226a4bd7cbde0692ae82b5a138b0d523fd5f25 --- .../launcher3/allapps/AllAppsTransitionController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 1cec9d0d94..0bee9b688d 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -228,6 +228,11 @@ public class AllAppsTransitionController public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config, PendingAnimation builder) { if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) { + // For atomic animations, we close the keyboard immediately. + if (!config.userControlled && !FeatureFlags.ENABLE_KEYBOARD_TRANSITION_SYNC.get()) { + mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); + } + builder.addEndListener(success -> { // Reset pull back progress and alpha after switching states. ALL_APPS_PULL_BACK_TRANSLATION.set(this, 0f); @@ -238,7 +243,7 @@ public class AllAppsTransitionController // the keyboard open and then changes their mind and swipes back up, we want the // keyboard to remain open. However an onCancel signal is sent to the listeners // (success = false), so we need to check for that. - if (success) { + if (config.userControlled && success) { mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); } });