diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index a572d73f5a..d973432d56 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -715,8 +715,8 @@ public class BubbleBarView extends FrameLayout { } /** Add a new bubble to the bubble bar without updating the selected bubble. */ - public void addBubble(BubbleView bubble) { - addBubble(bubble, /* bubbleToSelect = */ null); + public void addBubble(BubbleView bubble, boolean suppressAnimation) { + addBubble(bubble, /* bubbleToSelect = */ null, suppressAnimation); } /** @@ -725,12 +725,13 @@ public class BubbleBarView extends FrameLayout { * @param bubble bubble to add * @param bubbleToSelect if {@code null}, then selected bubble does not change */ - public void addBubble(BubbleView bubble, @Nullable BubbleView bubbleToSelect) { + public void addBubble(BubbleView bubble, @Nullable BubbleView bubbleToSelect, + boolean suppressAnimation) { FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams((int) mIconSize, (int) mIconSize, Gravity.LEFT); final int index = bubble.isOverflow() ? getChildCount() : 0; - if (isExpanded()) { + if (isExpanded() && !suppressAnimation) { // if we're expanded scale the new bubble in bubble.setScaleX(0f); bubble.setScaleY(0f); diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index e22577d262..6623e0642a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -1110,7 +1110,7 @@ public class BubbleBarViewController { if (mOverflowAdded == showOverflow) return; mOverflowAdded = showOverflow; if (mOverflowAdded) { - mBarView.addBubble(mOverflowBubble.getView()); + mBarView.addBubble(mOverflowBubble.getView(), /* suppressAnimation= */ true); mOverflowBubble.getView().setOnClickListener(mBubbleClickListener); mOverflowBubble.getView().setController(mBubbleViewController); } else { @@ -1157,7 +1157,7 @@ public class BubbleBarViewController { if (b != null) { BubbleView bubbleToSelectView = bubbleToSelect == null ? null : bubbleToSelect.getView(); - mBarView.addBubble(b.getView(), bubbleToSelectView); + mBarView.addBubble(b.getView(), bubbleToSelectView, suppressAnimation); b.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(b.getView()); b.getView().setController(mBubbleViewController); diff --git a/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewScreenshotTest.kt b/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewScreenshotTest.kt index a206d4e18b..2a391a1833 100644 --- a/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewScreenshotTest.kt +++ b/quickstep/tests/multivalentScreenshotTests/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewScreenshotTest.kt @@ -70,7 +70,7 @@ class BubbleBarViewScreenshotTest(emulationSpec: DeviceEmulationSpec) { screenshotRule.screenshotTest("bubbleBarView_collapsed_oneBubble") { activity -> activity.actionBar?.hide() setupBubbleBarView() - bubbleBarView.addBubble(createBubble("key1", Color.GREEN)) + bubbleBarView.addBubble(createBubble("key1", Color.GREEN), false) val container = FrameLayout(context) val lp = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT) container.layoutParams = lp @@ -84,8 +84,8 @@ class BubbleBarViewScreenshotTest(emulationSpec: DeviceEmulationSpec) { screenshotRule.screenshotTest("bubbleBarView_collapsed_twoBubbles") { activity -> activity.actionBar?.hide() setupBubbleBarView() - bubbleBarView.addBubble(createBubble("key1", Color.GREEN)) - bubbleBarView.addBubble(createBubble("key2", Color.CYAN)) + bubbleBarView.addBubble(createBubble("key1", Color.GREEN), false) + bubbleBarView.addBubble(createBubble("key2", Color.CYAN), false) val container = FrameLayout(context) val lp = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT) container.layoutParams = lp @@ -106,9 +106,9 @@ class BubbleBarViewScreenshotTest(emulationSpec: DeviceEmulationSpec) { ) { activity -> activity.actionBar?.hide() setupBubbleBarView() - bubbleBarView.addBubble(createBubble("key1", Color.GREEN)) - bubbleBarView.addBubble(createBubble("key2", Color.CYAN)) - bubbleBarView.addBubble(createBubble("key3", Color.MAGENTA)) + bubbleBarView.addBubble(createBubble("key1", Color.GREEN), false) + bubbleBarView.addBubble(createBubble("key2", Color.CYAN), false) + bubbleBarView.addBubble(createBubble("key3", Color.MAGENTA), false) val container = FrameLayout(context) val lp = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT) container.layoutParams = lp diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt index c721af0a0f..d2baec12a7 100644 --- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt +++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/stashing/TransientBubbleStashControllerTest.kt @@ -580,7 +580,7 @@ class TransientBubbleStashControllerTest { } ) bubbleView = BubbleView(context) - bubbleBarView.addBubble(bubbleView) + bubbleBarView.addBubble(bubbleView, false) bubbleBarView.layout(0, 0, BUBBLE_BAR_WIDTH, BUBBLE_BAR_HEIGHT) } }