diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java index 9a3dbc85087d1..6f9e2e5bf7095 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java @@ -50,6 +50,7 @@ public class AmbientState { private NotificationShelf mShelf; private int mZDistanceBetweenElements; private int mBaseZHeight; + private int mMaxLayoutHeight; public AmbientState(Context context) { reload(context); @@ -185,7 +186,7 @@ public class AmbientState { } public int getInnerHeight() { - return Math.max(mLayoutHeight - mTopPadding, mLayoutMinHeight); + return Math.max(Math.min(mLayoutHeight, mMaxLayoutHeight) - mTopPadding, mLayoutMinHeight); } public boolean isShadeExpanded() { @@ -223,4 +224,8 @@ public class AmbientState { public NotificationShelf getShelf() { return mShelf; } + + public void setLayoutMaxHeight(int maxLayoutHeight) { + mMaxLayoutHeight = maxLayoutHeight; + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index c9f819d0d44e6..20ca510b21bd1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -1926,6 +1926,7 @@ public class NotificationStackScrollLayout extends ViewGroup } mContentHeight = height + mTopPadding; updateScrollability(); + mAmbientState.setLayoutMaxHeight(mContentHeight); } private void updateScrollability() {