From fef9d249bdc6f36ec8c0d077f0b973eb08c72564 Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Tue, 9 Jul 2024 16:45:03 -0400 Subject: [PATCH] Fix bubble update animation Fix bubble update animation when the updated bubble is the only bubble in the bar. Flag: com.android.wm.shell.enable_bubble_bar Fixes: 352119655 Test: Manual: - Create 1 bubble in the bubble bar - Send an update for that bubble - Observe bubble bar is animated correctly Change-Id: If569810dacf0ef77147a822c53ddebd09e35fe15 --- .../launcher3/taskbar/bubbles/BubbleBarController.java | 3 ++- .../taskbar/bubbles/BubbleBarViewController.java | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index 4100e51884..a3832cdf8b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -394,7 +394,8 @@ 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); + mBubbleBarViewController.animateBubbleNotification( + bb, /* isExpanding= */ false, /* isUpdate= */ true); } 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 40e5b6435f..f2b5a94747 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -399,7 +399,7 @@ public class BubbleBarViewController { addedBubble.getView().setOnClickListener(mBubbleClickListener); mBubbleDragController.setupBubbleView(addedBubble.getView()); if (!suppressAnimation) { - animateBubbleNotification(addedBubble, isExpanding); + animateBubbleNotification(addedBubble, isExpanding, /* isUpdate= */ true); } } @@ -427,18 +427,19 @@ public class BubbleBarViewController { } return; } - animateBubbleNotification(bubble, isExpanding); + animateBubbleNotification(bubble, isExpanding, /* isUpdate= */ true); } 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) { + public void animateBubbleNotification(BubbleBarBubble bubble, boolean isExpanding, + boolean isUpdate) { 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) { + if (mBarView.getChildCount() <= 2 && !isUpdate) { mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding); return; }