diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index 400c3abc1d..f41498397d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -323,7 +323,6 @@ public class BubbleBarController extends IBubblesListener.Stub { final boolean suppressAnimation = update.initialState || mBubbleBarViewController.isHiddenForSysui(); - BubbleBarItem previouslySelectedBubble = mSelectedBubble; BubbleBarBubble bubbleToSelect = null; if (!update.removedBubbles.isEmpty()) { for (int i = 0; i < update.removedBubbles.size(); i++) { @@ -379,6 +378,7 @@ public class BubbleBarController extends IBubblesListener.Stub { BubbleBarBubble bb = mBubbles.get(update.updatedBubble.getKey()); // If we're not stashed, we're visible so animate bb.getView().updateDotVisibility(!mBubbleStashController.isStashed() /* animate */); + mBubbleBarViewController.animateBubbleNotification(bb, /* isExpanding= */ false); } if (update.bubbleKeysInOrder != null && !update.bubbleKeysInOrder.isEmpty()) { // Create the new list diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index fbdb2ed4e3..0722e4636a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -414,31 +414,31 @@ public class BubbleBarViewController { b.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(b.getView()); - if (suppressAnimation) { + if (suppressAnimation || !(b instanceof BubbleBarBubble bubble)) { return; } - - if (!(b instanceof BubbleBarBubble bubble)) { - return; - } - - boolean isInApp = mTaskbarStashController.isInApp(); - // if this is the first bubble, animate to the initial state. one bubble is the overflow - // so check for at most 2 children. - if (mBarView.getChildCount() <= 2) { - mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding); - return; - } - - // only animate the new bubble if we're in an app and not auto expanding - if (isInApp && !isExpanding && !isExpanded()) { - mBubbleBarViewAnimator.animateBubbleInForStashed(bubble); - } + animateBubbleNotification(bubble, isExpanding); } else { Log.w(TAG, "addBubble, bubble was null!"); } } + /** Animates the bubble bar to notify the user about a bubble change. */ + public void animateBubbleNotification(BubbleBarBubble bubble, boolean isExpanding) { + boolean isInApp = mTaskbarStashController.isInApp(); + // if this is the first bubble, animate to the initial state. one bubble is the overflow + // so check for at most 2 children. + if (mBarView.getChildCount() <= 2) { + mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding); + return; + } + + // only animate the new bubble if we're in an app and not auto expanding + if (isInApp && !isExpanding && !isExpanded()) { + mBubbleBarViewAnimator.animateBubbleInForStashed(bubble); + } + } + /** * Reorders the bubbles based on the provided list. */