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

Commit 527796c2 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Update stack design with vertical offset"

parents 000e6794 404a3c6f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1217,7 +1217,7 @@
    <!-- Interior padding of the message bubble -->
    <dimen name="bubble_message_padding">4dp</dimen>
    <!-- Offset between bubbles in their stacked position. -->
    <dimen name="bubble_stack_offset">5dp</dimen>
    <dimen name="bubble_stack_offset">10dp</dimen>
    <!-- How far offscreen the bubble stack rests. Cuts off padding and part of icon bitmap. -->
    <dimen name="bubble_stack_offscreen">9dp</dimen>
    <!-- How far down the screen the stack starts. -->
+2 −4
Original line number Diff line number Diff line
@@ -274,16 +274,14 @@ public class ExpandedAnimationController
                // Then, draw a line across the screen to the bubble's resting position.
                path.lineTo(getBubbleLeft(index), expandedY);
            } else {
                final float sideMultiplier =
                        mLayout.isFirstChildXLeftOfCenter(mCollapsePoint.x) ? -1 : 1;
                final float stackedX = mCollapsePoint.x + (sideMultiplier * index * mStackOffsetPx);
                final float stackedX = mCollapsePoint.x;

                // If we're collapsing, draw a line from the bubble's current position to the side
                // of the screen where the bubble will be stacked.
                path.lineTo(stackedX, expandedY);

                // Then, draw a line down to the stack position.
                path.lineTo(stackedX, mCollapsePoint.y);
                path.lineTo(stackedX, mCollapsePoint.y + index * mStackOffsetPx);
            }

            // The lead bubble should be the bubble with the longest distance to travel when we're
+2 −4
Original line number Diff line number Diff line
@@ -744,15 +744,13 @@ public class StackAnimationController extends

    @Override
    float getOffsetForChainedPropertyAnimation(DynamicAnimation.ViewProperty property) {
        if (property.equals(DynamicAnimation.TRANSLATION_X)) {
        if (property.equals(DynamicAnimation.TRANSLATION_Y)) {
            // If we're in the dismiss target, have the bubbles pile on top of each other with no
            // offset.
            if (isStackStuckToTarget()) {
                return 0f;
            } else {
                // Offset to the left if we're on the left, or the right otherwise.
                return mLayout.isFirstChildXLeftOfCenter(mStackPosition.x)
                        ? -mStackOffset : mStackOffset;
                return mStackOffset;
            }
        } else {
            return 0f;