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

Commit 2862f2ec authored by Joshua Tsuji's avatar Joshua Tsuji
Browse files

Update Z order and collapse animation destinations when bubbles reorder.

Bug: 137214359
Test: atest SystemUITests
Change-Id: I88169fd941853159235cabaf926e87b75f0aeb26
parent 3efcdc3c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -759,6 +759,8 @@ public class BubbleStackView extends FrameLayout {
            Bubble bubble = bubbles.get(i);
            mBubbleContainer.reorderView(bubble.getIconView(), i);
        }

        updateBubbleZOrdersAndDotPosition(false /* animate */);
    }

    /**
@@ -1078,7 +1080,7 @@ public class BubbleStackView extends FrameLayout {
                StatsLog.BUBBLE_UICHANGED__ACTION__STACK_MOVED);

        mStackOnLeftOrWillBe = newStackX <= 0;
        updateBubbleShadowsAndDotPosition(true /* animate */);
        updateBubbleZOrdersAndDotPosition(true /* animate */);
        hideDismissTarget();
    }

@@ -1555,11 +1557,11 @@ public class BubbleStackView extends FrameLayout {
        }

        mStackOnLeftOrWillBe = mStackAnimationController.isStackOnLeftSide();
        updateBubbleShadowsAndDotPosition(false);
        updateBubbleZOrdersAndDotPosition(false);
    }

    /** Sets the appropriate Z-order and dot position for each bubble in the stack. */
    private void updateBubbleShadowsAndDotPosition(boolean animate) {
    private void updateBubbleZOrdersAndDotPosition(boolean animate) {
        int bubbleCount = mBubbleContainer.getChildCount();
        for (int i = 0; i < bubbleCount; i++) {
            BubbleView bv = (BubbleView) mBubbleContainer.getChildAt(i);
+6 −0
Original line number Diff line number Diff line
@@ -456,6 +456,12 @@ public class ExpandedAnimationController
    @Override
    void onChildReordered(View child, int oldIndex, int newIndex) {
        updateBubblePositions();

        // We expect reordering during collapse, since we'll put the last selected bubble on top.
        // Update the collapse animation so they end up in the right stacked positions.
        if (mAnimatingCollapse) {
            startOrUpdatePathAnimation(false /* expanding */);
        }
    }

    private void updateBubblePositions() {