From 229696a0e44ff9753515fff8fdd8e2b19dcfe6bd Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Wed, 14 Aug 2024 03:47:35 -0400 Subject: [PATCH] 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 --- .../com/android/launcher3/taskbar/bubbles/BubbleBarView.java | 2 +- .../launcher3/taskbar/bubbles/BubbleBarViewController.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index 819c4737ea..9ebcd76c4c 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -1314,7 +1314,7 @@ public class BubbleBarView extends FrameLayout { } /** Returns the child count excluding the overflow if it's present. */ - private int getBubbleChildCount() { + int getBubbleChildCount() { return hasOverflow() ? getChildCount() - 1 : getChildCount(); } diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index 3261262621..f09e723dc7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -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; }