From 9b4484c9743170d5f193499bd61f9ed7b9ec2234 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Mon, 9 Sep 2024 09:36:21 -0700 Subject: [PATCH] Show bubble bar when hotseat icons are visible Fixes a flicker with bubble bar briefly attempting to stash when swiping up on home screen. Keeps bubble bar visible when dragging an icon on home screen. Bug: 365561149 Flag: com.android.wm.shell.enable_bubble_bar Test: swipe up on home screen, check that bubble bar does not stash Test: drag a home screen icon, check that bubble bar does not stash Change-Id: Ic8f4bf6051ed437167f369e8581a631b73e839b2 --- .../taskbar/LauncherTaskbarUIController.java | 5 ----- .../taskbar/TaskbarLauncherStateController.java | 12 +++++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index 69da7b6c02..177d01194a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -137,11 +137,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController { mHomeState.removeListener(mVisibilityChangeListener); } - /** Returns {@code true} if launcher is currently presenting the home screen. */ - public boolean isOnHome() { - return mTaskbarLauncherStateController.isOnHome(); - } - private void onInAppDisplayProgressChanged() { if (mControllers != null) { // Update our shared state so we can restore it if taskbar gets recreated. diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 4188a0f61a..060be15bf6 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -16,6 +16,7 @@ package com.android.launcher3.taskbar; import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_APP; import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_OVERVIEW; import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_STASHED_LAUNCHER_STATE; @@ -441,11 +442,6 @@ public class TaskbarLauncherStateController { return animator; } - /** Returns {@code true} if launcher is currently presenting the home screen. */ - public boolean isOnHome() { - return isInLauncher() && mLauncherState == LauncherState.NORMAL; - } - private Animator onStateChangeApplied(int changedFlags, long duration, boolean start) { final boolean isInLauncher = isInLauncher(); final boolean isIconAlignedWithHotseat = isIconAlignedWithHotseat(); @@ -457,9 +453,11 @@ public class TaskbarLauncherStateController { + ", toAlignment: " + toAlignment); } mControllers.bubbleControllers.ifPresent(controllers -> { - // Show the bubble bar when on launcher home or in overview. + // Show the bubble bar when on launcher home (hotseat icons visible) or in overview boolean onOverview = mLauncherState == LauncherState.OVERVIEW; - controllers.bubbleStashController.setBubblesShowingOnHome(isOnHome()); + boolean hotseatIconsVisible = isInLauncher && mLauncherState.areElementsVisible( + mLauncher, HOTSEAT_ICONS); + controllers.bubbleStashController.setBubblesShowingOnHome(hotseatIconsVisible); controllers.bubbleStashController.setBubblesShowingOnOverview(onOverview); });