diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index c9b05695337c5..56b9eabafa6a4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -1143,16 +1143,18 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable */ private void updateStackPosition() { // Consider interpolating from an mExpansionStartY for use on lockscreen and AOD - final float stackY = MathUtils.lerp(0, mTopPadding, mAmbientState.getExpansionFraction()); + final float fraction = mAmbientState.getExpansionFraction(); + final float stackY = MathUtils.lerp(0, mTopPadding, fraction); mAmbientState.setStackY(stackY); if (mOnStackYChanged != null) { mOnStackYChanged.run(); } - final float shadeBottom = getHeight() - getEmptyBottomMargin(); - mAmbientState.setStackEndHeight(shadeBottom - mTopPadding); + final float stackEndHeight = getHeight() - getEmptyBottomMargin() - mTopPadding; + mAmbientState.setStackEndHeight(stackEndHeight); mAmbientState.setStackHeight( - MathUtils.lerp(0, shadeBottom - mTopPadding, mAmbientState.getExpansionFraction())); + MathUtils.lerp(stackEndHeight * StackScrollAlgorithm.START_FRACTION, + stackEndHeight, fraction)); } void setOnStackYChanged(Runnable onStackYChanged) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index c1a5f148d4cab..413048d6ce54e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -42,6 +42,8 @@ import java.util.List; */ public class StackScrollAlgorithm { + public static final float START_FRACTION = 0.3f; + private static final String LOG_TAG = "StackScrollAlgorithm"; private final ViewGroup mHostView; @@ -442,7 +444,8 @@ public class StackScrollAlgorithm { maxViewHeight = algorithmState.viewHeightBeforeShelf; } } - viewState.height = (int) MathUtils.lerp(0, maxViewHeight, expansionFraction); + viewState.height = (int) MathUtils.lerp(maxViewHeight * START_FRACTION, maxViewHeight, + expansionFraction); } currentYPosition += viewState.height + expansionFraction * mPaddingBetweenElements;