If we're adding / removing a bubble, don't forget to add the overflow

One case I missed was a bubble being added/removed AND the overflow
showing... this isn't the nicest, but when the add/remove animation
is done, animate the overflow in.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 358304168
Test: manual - don't have the overflow showing, add a 6th bubble,
               observe that the overflow appears
Change-Id: I1a9cec3970f5535e935f3404fa6dbd6de2f69fa5
This commit is contained in:
Mady Mellor committed 2024-08-14 16:23:07 -07:00
1 parent fee62395a2
commit a7f2d83b61
3 files changed
+15 -6

No files matched your search

@@ -496,8 +496,10 @@ public class BubbleBarViewController {
/** Adds a new bubble and removes an old bubble at the same time. */
public void addBubbleAndRemoveBubble(BubbleBarBubble addedBubble,
BubbleBarBubble removedBubble, boolean isExpanding, boolean suppressAnimation) {
mBarView.addBubbleAndRemoveBubble(addedBubble.getView(), removedBubble.getView());
BubbleBarBubble removedBubble, boolean isExpanding, boolean suppressAnimation,
boolean addOverflowToo) {
mBarView.addBubbleAndRemoveBubble(addedBubble.getView(), removedBubble.getView(),
addOverflowToo ? () -> showOverflow(true) : null);
addedBubble.getView().setOnClickListener(mBubbleClickListener);
addedBubble.getView().setController(mBubbleViewController);
removedBubble.getView().setController(null);
@@ -531,7 +533,8 @@ public class BubbleBarViewController {
public void addOverflowAndRemoveBubble(BubbleBarBubble removedBubble) {
if (mOverflowAdded) return;
mOverflowAdded = true;
mBarView.addBubbleAndRemoveBubble(mOverflowBubble.getView(), removedBubble.getView());
mBarView.addBubbleAndRemoveBubble(mOverflowBubble.getView(), removedBubble.getView(),
null /* onEndRunnable */);
mOverflowBubble.getView().setOnClickListener(mBubbleClickListener);
mOverflowBubble.getView().setController(mBubbleViewController);
removedBubble.getView().setController(null);
@@ -541,7 +544,8 @@ public class BubbleBarViewController {
public void removeOverflowAndAddBubble(BubbleBarBubble addedBubble) {
if (!mOverflowAdded) return;
mOverflowAdded = false;
mBarView.addBubbleAndRemoveBubble(addedBubble.getView(), mOverflowBubble.getView());
mBarView.addBubbleAndRemoveBubble(addedBubble.getView(), mOverflowBubble.getView(),
null /* onEndRunnable */);
addedBubble.getView().setOnClickListener(mBubbleClickListener);
addedBubble.getView().setController(mBubbleViewController);
mOverflowBubble.getView().setController(null);