From 5605734a82f50158030b556f8287cf0438f7b48e Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Tue, 10 Apr 2018 11:49:18 -0700 Subject: Alignment of pulsing notifications Test: visual Change-Id: I1f42cfa26c80ed3f84682d807336477d19b64ec4 Fixes: 77278905 --- packages/SystemUI/res-keyguard/values/dimens.xml | 2 ++ .../phone/KeyguardClockPositionAlgorithm.java | 27 +++++++++++++++------- .../statusbar/phone/NotificationPanelView.java | 11 +++------ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/packages/SystemUI/res-keyguard/values/dimens.xml b/packages/SystemUI/res-keyguard/values/dimens.xml index addbf84cb4e8..37de4332bf43 100644 --- a/packages/SystemUI/res-keyguard/values/dimens.xml +++ b/packages/SystemUI/res-keyguard/values/dimens.xml @@ -47,6 +47,8 @@ 24sp 16sp + + 24dp 64dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java index 3d7067d1d799..1fb1ddd5e70a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java @@ -98,6 +98,11 @@ public class KeyguardClockPositionAlgorithm { */ private int mBurnInPreventionOffsetY; + /** + * Clock vertical padding when pulsing. + */ + private int mPulsingPadding; + /** * Doze/AOD transition amount. */ @@ -109,9 +114,9 @@ public class KeyguardClockPositionAlgorithm { private boolean mCurrentlySecure; /** - * If notification panel view currently has a touch. + * Dozing and receiving a notification (AOD notification.) */ - private boolean mTracking; + private boolean mPulsing; /** * Distance in pixels between the top of the screen and the first view of the bouncer. @@ -130,11 +135,13 @@ public class KeyguardClockPositionAlgorithm { R.dimen.burn_in_prevention_offset_x); mBurnInPreventionOffsetY = res.getDimensionPixelSize( R.dimen.burn_in_prevention_offset_y); + mPulsingPadding = res.getDimensionPixelSize( + R.dimen.widget_pulsing_bottom_padding); } public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight, float expandedHeight, float maxPanelHeight, int parentHeight, int keyguardStatusHeight, - float dark, boolean secure, boolean tracking, int bouncerTop) { + float dark, boolean secure, boolean pulsing, int bouncerTop) { mMinTopMargin = minTopMargin + mContainerTopPadding; mMaxShadeBottom = maxShadeBottom; mNotificationStackHeight = notificationStackHeight; @@ -144,7 +151,7 @@ public class KeyguardClockPositionAlgorithm { mKeyguardStatusHeight = keyguardStatusHeight; mDarkAmount = dark; mCurrentlySecure = secure; - mTracking = tracking; + mPulsing = pulsing; mBouncerTop = bouncerTop; } @@ -152,7 +159,7 @@ public class KeyguardClockPositionAlgorithm { final int y = getClockY(); result.clockY = y; result.clockAlpha = getClockAlpha(y); - result.stackScrollerPadding = y + mKeyguardStatusHeight; + result.stackScrollerPadding = y + (mPulsing ? 0 : mKeyguardStatusHeight); result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount); } @@ -194,9 +201,13 @@ public class KeyguardClockPositionAlgorithm { private int getClockY() { // Dark: Align the bottom edge of the clock at about half of the screen: - final float clockYDark = getMaxClockY() + burnInPreventionOffsetY(); - final float clockYRegular = getExpandedClockPosition(); - final boolean hasEnoughSpace = mMinTopMargin + mKeyguardStatusHeight < mBouncerTop; + float clockYDark = getMaxClockY() + burnInPreventionOffsetY(); + if (mPulsing) { + clockYDark -= mPulsingPadding; + } + + float clockYRegular = getExpandedClockPosition(); + boolean hasEnoughSpace = mMinTopMargin + mKeyguardStatusHeight < mBouncerTop; float clockYTarget = mCurrentlySecure && hasEnoughSpace ? mMinTopMargin : -mKeyguardStatusHeight; 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 b7af84a794c5..351633b590c8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -238,6 +238,7 @@ public class NotificationPanelView extends PanelView implements private boolean mIsFullWidth; private float mDarkAmount; private float mDarkAmountTarget; + private boolean mPulsing; private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mNoVisibleNotifications = true; private ValueAnimator mDarkAnimator; @@ -477,7 +478,7 @@ public class NotificationPanelView extends PanelView implements mKeyguardStatusView.getHeight(), mDarkAmount, mStatusBar.isKeyguardCurrentlySecure(), - mTracking, + mPulsing, mBouncerTop); mClockPositionAlgorithm.run(mClockPositionResult); if (animate || mClockAnimator != null) { @@ -2689,14 +2690,8 @@ public class NotificationPanelView extends PanelView implements positionClockAndNotifications(); } - public void setNoVisibleNotifications(boolean noNotifications) { - mNoVisibleNotifications = noNotifications; - if (mQs != null) { - mQs.setHasNotifications(!noNotifications); - } - } - public void setPulsing(boolean pulsing) { + mPulsing = pulsing; mKeyguardStatusView.setPulsing(pulsing); positionClockAndNotifications(); mNotificationStackScroller.setPulsing(pulsing, mKeyguardStatusView.getLocationOnScreen()[1] -- cgit v1.2.3-59-g8ed1b