From 4d8ad445c06ce85ef95f2b3f9bfb5d4d31c1ddd5 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Tue, 4 Jun 2024 22:36:35 +0100 Subject: [PATCH] Remove scrim view alpha when bubble manage menu is shown. Updated logic for taskbar scrim view alpha calculation, setting it to 0 when bubble manage menu is shown. Fixes: 337169457 Flag: NONE Test: Visual. For gesture navigation: 1) On foldable phone while device is being folded expand any bubble, click mange button, then unfold. Observe no scrim view is visible. 2) Enable persistent taskbar, pull down the notification shade then swipe it back up while bubbles are open. 3) Enable persistent taskbar, pull down the notification shade then swipe it back up while bubbles and mange menu is open. 4) Enable persistent taskbar. Fold device. Open bubble and click manage button. Unfold device. Observe no scrim view is visible. For 3 button navigation 1) Unfold the device, press the home key, pull down the notification shade then swipe it back up while bubbles are open. 2) Unfold the device, press the home key, pull down the notification shade then swipe it back up while bubbles and mange menu is open. 3) Fold device, open bubble and click manage button. Unfold device. Observe no scrim view is visible. Change-Id: Ic011ae9bd11801a479062cc51c60377823a926fb --- .../taskbar/TaskbarScrimViewController.java | 18 ++++++++++++------ .../launcher3/util/DisplayController.java | 4 +++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java index 92d9b23cb6..48d2bc2ff7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java @@ -103,14 +103,20 @@ public class TaskbarScrimViewController implements TaskbarControllers.LoggableTa } private float getScrimAlpha() { + final boolean isPersistentTaskBarVisible = + mTaskbarVisible && !DisplayController.isTransientTaskbar(mScrimView.getContext()); final boolean manageMenuExpanded = (mSysUiStateFlags & SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED) != 0; - return manageMenuExpanded - // When manage menu shows there's the first scrim and second scrim so figure out - // what the total transparency would be. - ? (BUBBLE_EXPANDED_SCRIM_ALPHA + (BUBBLE_EXPANDED_SCRIM_ALPHA - * (1 - BUBBLE_EXPANDED_SCRIM_ALPHA))) - : shouldShowScrim() ? BUBBLE_EXPANDED_SCRIM_ALPHA : 0; + if (isPersistentTaskBarVisible && manageMenuExpanded) { + // When manage menu shows for persistent task bar there's the first scrim and second + // scrim so figure out what the total transparency would be. + return BUBBLE_EXPANDED_SCRIM_ALPHA + + (BUBBLE_EXPANDED_SCRIM_ALPHA * (1 - BUBBLE_EXPANDED_SCRIM_ALPHA)); + } else if (shouldShowScrim()) { + return BUBBLE_EXPANDED_SCRIM_ALPHA; + } else { + return 0; + } } private void showScrim(boolean showScrim, float alpha, boolean skipAnim) { diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java index 92fc38ff71..fa01986535 100644 --- a/src/com/android/launcher3/util/DisplayController.java +++ b/src/com/android/launcher3/util/DisplayController.java @@ -174,7 +174,9 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { } /** - * Returns whether taskbar is transient. + * Returns whether taskbar is transient or persistent. + * + * @return {@code true} if transient, {@code false} if persistent. */ public static boolean isTransientTaskbar(Context context) { return INSTANCE.get(context).getInfo().isTransientTaskbar();