diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 7449a7701d656..62e7fa7ad7103 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -225,6 +225,9 @@ etc. --> 48dp + + 8dp + 124dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index af03440629db2..25e803edc863b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -239,6 +239,7 @@ public class NotificationPanelView extends PanelView implements private ValueAnimator mDarkAnimator; private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private boolean mUserSetupComplete; + private int mQsNotificationTopPadding; public NotificationPanelView(Context context, AttributeSet attrs) { super(context, attrs); @@ -307,6 +308,8 @@ public class NotificationPanelView extends PanelView implements R.dimen.max_notification_fadeout_height); mIndicationBottomPadding = getResources().getDimensionPixelSize( R.dimen.keyguard_indication_bottom_padding); + mQsNotificationTopPadding = getResources().getDimensionPixelSize( + R.dimen.qs_notification_keyguard_padding); } public void updateResources() { @@ -818,7 +821,7 @@ public class NotificationPanelView extends PanelView implements private float getQsExpansionFraction() { return Math.min(1f, (mQsExpansionHeight - mQsMinExpansionHeight) - / (getTempQsMaxExpansion() - mQsMinExpansionHeight)); + / (mQsMaxExpansionHeight - mQsMinExpansionHeight)); } @Override @@ -1361,7 +1364,7 @@ public class NotificationPanelView extends PanelView implements // take the maximum and linearly interpolate with the panel expansion for a nice motion. int maxNotifications = mClockPositionResult.stackScrollerPadding - mClockPositionResult.stackScrollerPaddingAdjustment; - int maxQs = getTempQsMaxExpansion(); + int maxQs = mQsMaxExpansionHeight + mQsNotificationTopPadding; int max = mStatusBarState == StatusBarState.KEYGUARD ? Math.max(maxNotifications, maxQs) : maxQs; @@ -1375,7 +1378,7 @@ public class NotificationPanelView extends PanelView implements // from a scrolled quick settings. return interpolate(getQsExpansionFraction(), mNotificationStackScroller.getIntrinsicPadding(), - mQsMaxExpansionHeight); + mQsMaxExpansionHeight + mQsNotificationTopPadding); } else { return mQsExpansionHeight; } @@ -1544,7 +1547,7 @@ public class NotificationPanelView extends PanelView implements / (panelHeightQsExpanded - panelHeightQsCollapsed); } setQsExpansion(mQsMinExpansionHeight - + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight)); + + t * (mQsMaxExpansionHeight - mQsMinExpansionHeight)); } updateExpandedHeight(expandedHeight); updateHeader(); @@ -1566,14 +1569,6 @@ public class NotificationPanelView extends PanelView implements } } - /** - * @return a temporary override of {@link #mQsMaxExpansionHeight}, which is needed when - * collapsing QS / the panel when QS was scrolled - */ - private int getTempQsMaxExpansion() { - return mQsMaxExpansionHeight; - } - private int calculatePanelHeightShade() { int emptyBottomMargin = mNotificationStackScroller.getEmptyBottomMargin(); int maxHeight = mNotificationStackScroller.getHeight() - emptyBottomMargin @@ -1596,6 +1591,10 @@ public class NotificationPanelView extends PanelView implements } int maxQsHeight = mQsMaxExpansionHeight; + if (mKeyguardShowing) { + maxQsHeight += mQsNotificationTopPadding; + } + // If an animation is changing the size of the QS panel, take the animated value. if (mQsSizeChangeAnimator != null) { maxQsHeight = (int) mQsSizeChangeAnimator.getAnimatedValue();