From e175eea012868305ef17f0b8adab11f3cddf8127 Mon Sep 17 00:00:00 2001 From: Toni Barzic Date: Sat, 26 Apr 2025 04:57:38 +0000 Subject: [PATCH] Use setQsbAlpha to update qsb alpha When updating hotseat qsb alpha in response to assistant visiblity changes, use Hotseat.setQsbAlpha with a designated alpha channel instead of updating the view alpha directly. QSB alpha can be changed for different reasons - e.g. because taskbar is shown, so the calling View.setAlpha directly may overrride visibility set from other sources. Using setQsbAlpha ensures that the final qsb alpha aggregates all alpha inputs. Bug: 413500588 Flag: EXEMPT bugfix Test: On desktop device (where taskbar is shown on home), connect a display while on home, and verify the inline hotseat qsb does not become visible on the primary display. Change-Id: Ida2325aa630c0c2d2c324d5e3001207cf661f2e9 --- src/com/android/launcher3/Hotseat.java | 5 +++-- src/com/android/launcher3/Launcher.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 19e8f95e01..ef0f44f1fd 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -57,11 +57,12 @@ public class Hotseat extends CellLayout implements Insettable { public static final int ALPHA_CHANNEL_TASKBAR_ALIGNMENT = 0; public static final int ALPHA_CHANNEL_PREVIEW_RENDERER = 1; public static final int ALPHA_CHANNEL_TASKBAR_STASH = 2; - public static final int ALPHA_CHANNEL_CHANNELS_COUNT = 3; + public static final int ALPHA_CHANNEL_ASSISTANT_VISIBILITY = 3; + public static final int ALPHA_CHANNEL_CHANNELS_COUNT = 4; @Retention(RetentionPolicy.RUNTIME) @IntDef({ALPHA_CHANNEL_TASKBAR_ALIGNMENT, ALPHA_CHANNEL_PREVIEW_RENDERER, - ALPHA_CHANNEL_TASKBAR_STASH}) + ALPHA_CHANNEL_TASKBAR_STASH, ALPHA_CHANNEL_ASSISTANT_VISIBILITY}) public @interface HotseatQsbAlphaId { } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index fccec91e7e..c9efa8cbb7 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -809,7 +809,7 @@ public class Launcher extends StatefulActivity } public void onAssistantVisibilityChanged(float visibility) { - mHotseat.getQsb().setAlpha(1f - visibility); + mHotseat.setQsbAlpha(1f - visibility, Hotseat.ALPHA_CHANNEL_ASSISTANT_VISIBILITY); } /**