From 404a3c6fc3abfdc10ab48a17e0754b4b1cadffd9 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Tue, 13 Oct 2020 22:22:32 -0500 Subject: [PATCH] Update stack design with vertical offset Fixes: 158492043 Test: matches specs Change-Id: I6255594fb5399daee956c3ec54be75adae09c346 --- packages/SystemUI/res/values/dimens.xml | 2 +- .../bubbles/animation/ExpandedAnimationController.java | 6 ++---- .../bubbles/animation/StackAnimationController.java | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 7cbbaf9a00aca..26b3ab8318428 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1217,7 +1217,7 @@ 4dp - 5dp + 10dp 9dp diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java index 9f88ee55082d7..1d34d9b899d4b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java @@ -271,16 +271,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 diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java index b7490a52f475a..b6be9d78af735 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java @@ -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;