From 273f9ec4873b208d532ded1ff34ed0b5f915849e Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Fri, 31 May 2024 10:42:59 -0400 Subject: [PATCH] Fix bubble bar and handle visibility on first bubble When the animation of the first bubble is suppressed, immediately stash or show the bubble bar to make sure it has been initialized correctly. Also we no longer automatically update the bubble bar visibility based on its alpha value, since we're managing alpha and visibility ourselves. Flag: com.android.wm.shell.enable_bubble_bar Fixes: 343505267 Fixes: 343502240 Test: manually verified state for the following scenarios for the first bubble - in app when keyboard is open - in app -> open shade - in app -> lock device - on home -> open shade - on home -> lock device - in overview -> open shade Test: manually sanity tested to make sure animations for more bubbles still work Test: manual - Open test bubble app - Open keyboard and send a bubble - The bubble should animate using a HUN since the keyboard is open - Swipe back to hide the keyboard - Observe that the bubble bar no longer shows to stash into the handle Change-Id: I754a5a9c8e961af0cdd5ccadf83d3081d4414c7e --- .../taskbar/bubbles/BubbleBarViewController.java | 13 ++++++++++++- .../taskbar/bubbles/BubbleStashController.java | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index f614dc66ea..45a9fa16e3 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -98,7 +98,6 @@ public class BubbleBarViewController { mBarView = barView; mSystemUiProxy = SystemUiProxy.INSTANCE.get(mActivity); mBubbleBarAlpha = new MultiValueAlpha(mBarView, 1 /* num alpha channels */); - mBubbleBarAlpha.setUpdateVisibility(true); mIconSize = activity.getResources().getDimensionPixelSize( R.dimen.bubblebar_icon_size); } @@ -408,7 +407,19 @@ public class BubbleBarViewController { b.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(b.getView()); + if (b instanceof BubbleBarOverflow) { + return; + } + if (suppressAnimation || !(b instanceof BubbleBarBubble bubble)) { + // the bubble bar and handle are initialized as part of the first bubble animation. + // if the animation is suppressed, immediately stash or show the bubble bar to + // ensure they've been initialized. + if (mTaskbarStashController.isInApp()) { + mBubbleStashController.stashBubbleBarImmediate(); + } else { + mBubbleStashController.showBubbleBarImmediate(); + } return; } animateBubbleNotification(bubble, isExpanding); diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java index 5d01b9bd08..74ddf90afc 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java @@ -418,6 +418,7 @@ public class BubbleStashController { /** Stashes the bubble bar immediately without animation. */ public void stashBubbleBarImmediate() { mHandleViewController.setTranslationYForSwipe(0); + mBubbleStashedHandleAlpha.setValue(1); mIconAlphaForStash.setValue(0); mIconTranslationYForStash.updateValue(getStashTranslation()); mIconScaleForStash.updateValue(STASHED_BAR_SCALE);