Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3f7992c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Cap the width of the bubble bar when collapsed" into udc-qpr-dev am:...

Merge "Cap the width of the bubble bar when collapsed" into udc-qpr-dev am: dddd60e8 am: dc1b0802

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/24446027



Change-Id: I21ee0ac1a10c9769e9091d2743fdcc88fe64f0a1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b80b50a0 dc1b0802
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ public class BubbleBarView extends FrameLayout {
            // the position of the bubble when the bar is fully expanded
            final float expandedX = i * (mIconSize + mIconSpacing);
            // the position of the bubble when the bar is fully collapsed
            final float collapsedX = i * mIconOverlapAmount;
            final float collapsedX = i == 0 ? 0 : mIconOverlapAmount;

            if (mIsBarExpanded) {
                // where the bubble will end up when the animation ends
@@ -292,12 +292,22 @@ public class BubbleBarView extends FrameLayout {
                }
                // When we're expanded, we're not stacked so we're not behind the stack
                bv.setBehindStack(false, animate);
                bv.setAlpha(1);
            } else {
                final float targetX = currentWidth - collapsedWidth + collapsedX;
                bv.setTranslationX(widthState * (expandedX - targetX) + targetX);
                bv.setZ((MAX_BUBBLES * mBubbleElevation) - i);
                // If we're not the first bubble we're behind the stack
                bv.setBehindStack(i > 0, animate);
                // If we're fully collapsed, hide all bubbles except for the first 2. If there are
                // only 2 bubbles, hide the second bubble as well because it's the overflow.
                if (widthState == 0) {
                    if (i > 1) {
                        bv.setAlpha(0);
                    } else if (i == 1 && bubbleCount == 2) {
                        bv.setAlpha(0);
                    }
                }
            }
        }

@@ -458,7 +468,11 @@ public class BubbleBarView extends FrameLayout {
    private float collapsedWidth() {
        final int childCount = getChildCount();
        final int horizontalPadding = getPaddingStart() + getPaddingEnd();
        return mIconSize + ((childCount - 1) * mIconOverlapAmount) + horizontalPadding;
        // If there are more than 2 bubbles, the first 2 should be visible when collapsed.
        // Otherwise just the first bubble should be visible because we don't show the overflow.
        return childCount > 2
                ? mIconSize + mIconOverlapAmount + horizontalPadding
                : mIconSize + horizontalPadding;
    }

    /**