Check bubble count for initial state animation

With optional overflow, we need to check for actual bubble count
before animating the bubble bar to its initial state.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 359403793
Test: manual
       - create first bubble on home
       - observe bubble bar animates correctly to initial state
       - add second bubble
       - observe bubble bar bounces correctly and does not slide
         in from the bottom of the screen
Change-Id: I53a34bc00b24e8a6504bcca0532054755554b9ac
This commit is contained in:
Liran Binyamin
2024-08-14 03:47:35 -04:00
parent de9b1df642
commit 229696a0e4
2 changed files with 3 additions and 4 deletions
@@ -579,9 +579,8 @@ public class BubbleBarViewController {
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 && !isUpdate) {
// if this is the first bubble, animate to the initial state.
if (mBarView.getBubbleChildCount() == 1 && !isUpdate) {
mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding);
return;
}