Merge changes I74b09220,Id7e2db5f into main

* changes:
  Don't animate bubbles in the initial state update
  Suppress animation for bubbles that auto expand
This commit is contained in:
Liran Binyamin
2024-04-08 16:30:30 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 5 deletions
@@ -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 {