From c5e77d97175c240ba84df7a65d936154300d4433 Mon Sep 17 00:00:00 2001 From: Artsiom Mitrokhin Date: Tue, 19 Nov 2024 17:31:45 -0500 Subject: [PATCH] Fix the overflow button getting stuck in the dot position The root cause was that there were other unaccounted code paths inside `KeyboardQuickSwitchViewController` that were causing the KQS view to be closed. The fix introduces a new `onCloseStarted` callback that is called before closing the KQS view. This allows to toggle the overflow button together with the KQS closing animation (in case it closes with animation). Bug: 379614917 Flag: com.android.launcher3.taskbar_overflow Test: manual, following steps in the bug Change-Id: I1868142c1cdba8111cb86c4c54e5b12b643732c5 --- .../taskbar/KeyboardQuickSwitchController.java | 11 +++++++---- .../taskbar/KeyboardQuickSwitchViewController.java | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java index 3b7ad3e618..de42669000 100644 --- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java +++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java @@ -299,10 +299,6 @@ public final class KeyboardQuickSwitchController implements return; } mQuickSwitchViewController.closeQuickSwitchView(animate); - if (mOnClosed != null) { - mOnClosed.run(); - mOnClosed = null; - } } /** @@ -394,6 +390,13 @@ public final class KeyboardQuickSwitchController implements }); } + void onCloseStarted() { + if (mOnClosed != null) { + mOnClosed.run(); + mOnClosed = null; + } + } + void onCloseComplete() { if (Flags.taskbarOverflow() && mOverlayContext != null) { mOverlayContext.getDragLayer() diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java index 985cc26d8e..e623b21bb9 100644 --- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java @@ -198,6 +198,7 @@ public class KeyboardQuickSwitchViewController { // Let currently-running animation finish. return; } + mControllerCallbacks.onCloseStarted(); if (!animate) { InteractionJankMonitorWrapper.begin( mKeyboardQuickSwitchView, Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_CLOSE);