diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index bae30e316e..a2c1b07112 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -241,7 +241,8 @@ public class BubbleBarController extends IBubblesListener.Stub { // we're on the main executor now, so check that the overflow hasn't been created // again to avoid races. if (mOverflowBubble == null) { - mBubbleBarViewController.addBubble(overflow); + mBubbleBarViewController.addBubble( + overflow, /* isExpanding= */ false, /* suppressAnimation= */ true); mOverflowBubble = overflow; } }); @@ -310,6 +311,10 @@ public class BubbleBarController extends IBubblesListener.Stub { private void applyViewChanges(BubbleBarViewUpdate update) { final boolean isCollapsed = (update.expandedChanged && !update.expanded) || (!update.expandedChanged && !mBubbleBarViewController.isExpanded()); + final boolean isExpanding = update.expandedChanged && update.expanded; + // don't animate bubbles if this is the initial state because we may be unfolding or + // enabling gesture nav + final boolean suppressAnimation = update.initialState; BubbleBarItem previouslySelectedBubble = mSelectedBubble; BubbleBarBubble bubbleToSelect = null; if (!update.removedBubbles.isEmpty()) { @@ -326,7 +331,7 @@ public class BubbleBarController extends IBubblesListener.Stub { } if (update.addedBubble != null) { mBubbles.put(update.addedBubble.getKey(), update.addedBubble); - mBubbleBarViewController.addBubble(update.addedBubble); + mBubbleBarViewController.addBubble(update.addedBubble, isExpanding, suppressAnimation); if (isCollapsed) { // If we're collapsed, the most recently added bubble will be selected. bubbleToSelect = update.addedBubble; @@ -339,7 +344,7 @@ public class BubbleBarController extends IBubblesListener.Stub { BubbleBarBubble bubble = update.currentBubbles.get(i); if (bubble != null) { mBubbles.put(bubble.getKey(), bubble); - mBubbleBarViewController.addBubble(bubble); + mBubbleBarViewController.addBubble(bubble, isExpanding, suppressAnimation); if (isCollapsed) { // If we're collapsed, the most recently added bubble will be selected. bubbleToSelect = bubble; diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index 06769c530a..aa1b4dfb40 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -329,16 +329,21 @@ public class BubbleBarViewController { /** * Adds the provided bubble to the bubble bar. */ - public void addBubble(BubbleBarItem b) { + public void addBubble(BubbleBarItem b, boolean isExpanding, boolean suppressAnimation) { if (b != null) { mBarView.addView(b.getView(), 0, new FrameLayout.LayoutParams(mIconSize, mIconSize, Gravity.LEFT)); b.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(b.getView()); + if (suppressAnimation) { + return; + } + boolean isStashedOrGone = mBubbleStashController.isStashed() || mBarView.getVisibility() != VISIBLE; - if (b instanceof BubbleBarBubble && isStashedOrGone) { + // don't animate the new bubble if we're auto expanding from stashed + if (b instanceof BubbleBarBubble && isStashedOrGone && !isExpanding) { mBubbleBarViewAnimator.animateBubbleInForStashed((BubbleBarBubble) b); } } else {