Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +3 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,9 @@ public class KeyguardStatusView extends GridLayout { } public void setDark(boolean dark) { if (mDark == dark) { return; } mDark = dark; final int N = mClockContainer.getChildCount(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +14 −7 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.view.animation.AccelerateInterpolator; import android.view.animation.PathInterpolator; import com.android.systemui.R; import com.android.systemui.statusbar.notification.NotificationUtils; /** * Utility class to calculate the clock position and top padding of notifications on Keyguard. Loading Loading @@ -69,7 +70,7 @@ public class KeyguardClockPositionAlgorithm { private AccelerateInterpolator mAccelerateInterpolator = new AccelerateInterpolator(); private int mClockBottom; private boolean mDark; private float mDarkAmount; /** * Refreshes the dimension values. Loading @@ -89,7 +90,7 @@ public class KeyguardClockPositionAlgorithm { public void setup(int maxKeyguardNotifications, int maxPanelHeight, float expandedHeight, int notificationCount, int height, int keyguardStatusHeight, float emptyDragAmount, int clockBottom, boolean dark) { int clockBottom, float dark) { mMaxKeyguardNotifications = maxKeyguardNotifications; mMaxPanelHeight = maxPanelHeight; mExpandedHeight = expandedHeight; Loading @@ -98,7 +99,7 @@ public class KeyguardClockPositionAlgorithm { mKeyguardStatusHeight = keyguardStatusHeight; mEmptyDragAmount = emptyDragAmount; mClockBottom = clockBottom; mDark = dark; mDarkAmount = dark; } public float getMinStackScrollerPadding(int height, int keyguardStatusHeight) { Loading @@ -120,9 +121,11 @@ public class KeyguardClockPositionAlgorithm { result.clockY, y + getClockNotificationsPadding() + mKeyguardStatusHeight); result.clockAlpha = getClockAlpha(result.clockScale); if (mDark) { result.stackScrollerPadding = mClockBottom + y; } result.stackScrollerPadding = (int) NotificationUtils.interpolate( result.stackScrollerPadding, mClockBottom + y, mDarkAmount); } private float getClockScale(int notificationPadding, int clockY, int startPadding) { Loading @@ -149,7 +152,11 @@ public class KeyguardClockPositionAlgorithm { } private int getClockY() { return (int) (getClockYFraction() * mHeight); // Dark: Align the bottom edge of the clock at one third: // clockBottomEdge = result - mKeyguardStatusHeight / 2 + mClockBottom float clockYDark = (0.33f * mHeight + (float) mKeyguardStatusHeight / 2 - mClockBottom); float clockYRegular = getClockYFraction() * mHeight; return (int) NotificationUtils.interpolate(clockYRegular, clockYDark, mDarkAmount); } private float getClockYExpansionAdjustment() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +38 −5 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.util.FloatProperty; import android.util.MathUtils; import android.view.MotionEvent; import android.view.VelocityTracker; Loading Loading @@ -92,6 +93,19 @@ public class NotificationPanelView extends PanelView implements public static final long DOZE_ANIMATION_DURATION = 700; private static final FloatProperty<NotificationPanelView> SET_DARK_AMOUNT_PROPERTY = new FloatProperty<NotificationPanelView>("mDarkAmount") { @Override public void setValue(NotificationPanelView object, float value) { object.setDarkAmount(value); } @Override public Float get(NotificationPanelView object) { return object.mDarkAmount; } }; private KeyguardAffordanceHelper mAffordanceHelper; private KeyguardUserSwitcher mKeyguardUserSwitcher; private KeyguardStatusBarView mKeyguardStatusBar; Loading Loading @@ -214,9 +228,10 @@ public class NotificationPanelView extends PanelView implements private int mIndicationBottomPadding; private int mAmbientIndicationBottomPadding; private boolean mIsFullWidth; private boolean mDark; private float mDarkAmount; private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mNoVisibleNotifications = true; private ValueAnimator mDarkAnimator; public NotificationPanelView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -402,7 +417,7 @@ public class NotificationPanelView extends PanelView implements mKeyguardStatusView.getHeight(), mEmptyDragAmount, mKeyguardStatusView.getClockBottom(), mDark); mDarkAmount); mClockPositionAlgorithm.run(mClockPositionResult); if (animate || mClockAnimator != null) { startClockAnimation(mClockPositionResult.clockY); Loading Loading @@ -2488,9 +2503,27 @@ public class NotificationPanelView extends PanelView implements } } public void setDark(boolean dark) { mDark = dark; mKeyguardStatusView.setDark(dark); public void setDark(boolean dark, boolean animate) { float darkAmount = dark ? 1 : 0; if (mDarkAmount == darkAmount) { return; } if (mDarkAnimator != null && mDarkAnimator.isRunning()) { mDarkAnimator.cancel(); } if (animate) { mDarkAnimator = ObjectAnimator.ofFloat(this, SET_DARK_AMOUNT_PROPERTY, darkAmount); mDarkAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN); mDarkAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); mDarkAnimator.start(); } else { setDarkAmount(darkAmount); } } private void setDarkAmount(float amount) { mDarkAmount = amount; mKeyguardStatusView.setDark(amount == 1); positionClockAndNotifications(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -4419,7 +4419,7 @@ public class StatusBar extends SystemUI implements DemoMode, mStackScroller.setDark(mDozing, animate, mWakeUpTouchLocation); mScrimController.setDozing(mDozing); mKeyguardIndicationController.setDozing(mDozing); mNotificationPanel.setDark(mDozing); mNotificationPanel.setDark(mDozing, animate); updateQsExpansionEnabled(); // Immediately abort the dozing from the doze scrim controller in case of wake-and-unlock Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +3 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,9 @@ public class KeyguardStatusView extends GridLayout { } public void setDark(boolean dark) { if (mDark == dark) { return; } mDark = dark; final int N = mClockContainer.getChildCount(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +14 −7 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.view.animation.AccelerateInterpolator; import android.view.animation.PathInterpolator; import com.android.systemui.R; import com.android.systemui.statusbar.notification.NotificationUtils; /** * Utility class to calculate the clock position and top padding of notifications on Keyguard. Loading Loading @@ -69,7 +70,7 @@ public class KeyguardClockPositionAlgorithm { private AccelerateInterpolator mAccelerateInterpolator = new AccelerateInterpolator(); private int mClockBottom; private boolean mDark; private float mDarkAmount; /** * Refreshes the dimension values. Loading @@ -89,7 +90,7 @@ public class KeyguardClockPositionAlgorithm { public void setup(int maxKeyguardNotifications, int maxPanelHeight, float expandedHeight, int notificationCount, int height, int keyguardStatusHeight, float emptyDragAmount, int clockBottom, boolean dark) { int clockBottom, float dark) { mMaxKeyguardNotifications = maxKeyguardNotifications; mMaxPanelHeight = maxPanelHeight; mExpandedHeight = expandedHeight; Loading @@ -98,7 +99,7 @@ public class KeyguardClockPositionAlgorithm { mKeyguardStatusHeight = keyguardStatusHeight; mEmptyDragAmount = emptyDragAmount; mClockBottom = clockBottom; mDark = dark; mDarkAmount = dark; } public float getMinStackScrollerPadding(int height, int keyguardStatusHeight) { Loading @@ -120,9 +121,11 @@ public class KeyguardClockPositionAlgorithm { result.clockY, y + getClockNotificationsPadding() + mKeyguardStatusHeight); result.clockAlpha = getClockAlpha(result.clockScale); if (mDark) { result.stackScrollerPadding = mClockBottom + y; } result.stackScrollerPadding = (int) NotificationUtils.interpolate( result.stackScrollerPadding, mClockBottom + y, mDarkAmount); } private float getClockScale(int notificationPadding, int clockY, int startPadding) { Loading @@ -149,7 +152,11 @@ public class KeyguardClockPositionAlgorithm { } private int getClockY() { return (int) (getClockYFraction() * mHeight); // Dark: Align the bottom edge of the clock at one third: // clockBottomEdge = result - mKeyguardStatusHeight / 2 + mClockBottom float clockYDark = (0.33f * mHeight + (float) mKeyguardStatusHeight / 2 - mClockBottom); float clockYRegular = getClockYFraction() * mHeight; return (int) NotificationUtils.interpolate(clockYRegular, clockYDark, mDarkAmount); } private float getClockYExpansionAdjustment() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +38 −5 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.util.FloatProperty; import android.util.MathUtils; import android.view.MotionEvent; import android.view.VelocityTracker; Loading Loading @@ -92,6 +93,19 @@ public class NotificationPanelView extends PanelView implements public static final long DOZE_ANIMATION_DURATION = 700; private static final FloatProperty<NotificationPanelView> SET_DARK_AMOUNT_PROPERTY = new FloatProperty<NotificationPanelView>("mDarkAmount") { @Override public void setValue(NotificationPanelView object, float value) { object.setDarkAmount(value); } @Override public Float get(NotificationPanelView object) { return object.mDarkAmount; } }; private KeyguardAffordanceHelper mAffordanceHelper; private KeyguardUserSwitcher mKeyguardUserSwitcher; private KeyguardStatusBarView mKeyguardStatusBar; Loading Loading @@ -214,9 +228,10 @@ public class NotificationPanelView extends PanelView implements private int mIndicationBottomPadding; private int mAmbientIndicationBottomPadding; private boolean mIsFullWidth; private boolean mDark; private float mDarkAmount; private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mNoVisibleNotifications = true; private ValueAnimator mDarkAnimator; public NotificationPanelView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -402,7 +417,7 @@ public class NotificationPanelView extends PanelView implements mKeyguardStatusView.getHeight(), mEmptyDragAmount, mKeyguardStatusView.getClockBottom(), mDark); mDarkAmount); mClockPositionAlgorithm.run(mClockPositionResult); if (animate || mClockAnimator != null) { startClockAnimation(mClockPositionResult.clockY); Loading Loading @@ -2488,9 +2503,27 @@ public class NotificationPanelView extends PanelView implements } } public void setDark(boolean dark) { mDark = dark; mKeyguardStatusView.setDark(dark); public void setDark(boolean dark, boolean animate) { float darkAmount = dark ? 1 : 0; if (mDarkAmount == darkAmount) { return; } if (mDarkAnimator != null && mDarkAnimator.isRunning()) { mDarkAnimator.cancel(); } if (animate) { mDarkAnimator = ObjectAnimator.ofFloat(this, SET_DARK_AMOUNT_PROPERTY, darkAmount); mDarkAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN); mDarkAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); mDarkAnimator.start(); } else { setDarkAmount(darkAmount); } } private void setDarkAmount(float amount) { mDarkAmount = amount; mKeyguardStatusView.setDark(amount == 1); positionClockAndNotifications(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -4419,7 +4419,7 @@ public class StatusBar extends SystemUI implements DemoMode, mStackScroller.setDark(mDozing, animate, mWakeUpTouchLocation); mScrimController.setDozing(mDozing); mKeyguardIndicationController.setDozing(mDozing); mNotificationPanel.setDark(mDozing); mNotificationPanel.setDark(mDozing, animate); updateQsExpansionEnabled(); // Immediately abort the dozing from the doze scrim controller in case of wake-and-unlock Loading