diff options
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 @@ <dimen name="widget_title_font_size">24sp</dimen> <!-- Slice subtitle --> <dimen name="widget_label_font_size">16sp</dimen> + <!-- Slice offset when pulsing --> + <dimen name="widget_pulsing_bottom_padding">24dp</dimen> <!-- Clock without header --> <dimen name="widget_big_font_size">64dp</dimen> <!-- Clock with header --> 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 @@ -99,6 +99,11 @@ public class KeyguardClockPositionAlgorithm { private int mBurnInPreventionOffsetY; /** + * Clock vertical padding when pulsing. + */ + private int mPulsingPadding; + + /** * Doze/AOD transition amount. */ private float mDarkAmount; @@ -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] |