Fix bubble tx when the bar is collapsed

The previous behavior positioned the second bubble correctly but all
other bubbles behind the second bubble.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 366254467
Test: manual
       - create multiple bubbles in the bubble bar
       - expand and collapse the bubble bar and observe bubbles
         move correctly from right to left when expanding and from
         left to right when collapsing
Change-Id: I1db6daf629826af8d079a27d582e0c7e89fe2289
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
index 06301c7..8ab1ae7 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
@@ -1093,10 +1093,13 @@
                 translationX = 0f;
             }
         } else {
-            if (bubbleIndex == 1 && getBubbleChildCount() >= MAX_VISIBLE_BUBBLES_COLLAPSED) {
-                translationX = mIconOverlapAmount;
-            } else {
+            // when the bar is on the right, the first bubble always has translation 0. the only
+            // case where another bubble has translation 0 is when we only have 1 bubble and the
+            // overflow. otherwise all other bubbles should be shifted by the overlap amount.
+            if (bubbleIndex == 0 || getBubbleChildCount() == 1) {
                 translationX = 0f;
+            } else {
+                translationX = mIconOverlapAmount;
             }
         }
         return mBubbleBarPadding + translationX - getScaleIconShift();