Loading packages/SystemUI/res/values-h800dp/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ <resources> <!-- Minimum margin between clock and top of screen or ambient indication --> <dimen name="keyguard_clock_top_margin">76dp</dimen> <dimen name="keyguard_clock_top_margin">38dp</dimen> <!-- Large clock maximum font size (dp is intentional, to prevent any further scaling) --> <dimen name="large_clock_text_size">200dp</dimen> Loading packages/SystemUI/res/values/dimens.xml +4 −6 Original line number Diff line number Diff line Loading @@ -750,9 +750,7 @@ <!-- The margin between the status view and the notifications on Keyguard.--> <dimen name="keyguard_status_view_bottom_margin">20dp</dimen> <!-- Minimum margin between clock and status bar --> <dimen name="keyguard_clock_top_margin">36dp</dimen> <!-- The margin between top of clock and bottom of lock icon. --> <dimen name="keyguard_clock_lock_margin">16dp</dimen> <dimen name="keyguard_clock_top_margin">18dp</dimen> <!-- The amount to shift the clocks during a small/large transition --> <dimen name="keyguard_clock_switch_y_shift">10dp</dimen> <!-- When large clock is showing, offset the smartspace by this amount --> Loading Loading @@ -1157,9 +1155,9 @@ <dimen name="default_burn_in_prevention_offset">15dp</dimen> <!-- The maximum offset for the under-display fingerprint sensor (UDFPS) icon in either direction that elements aer moved to prevent burn-in on AOD--> <dimen name="udfps_burn_in_offset_x">2dp</dimen> <dimen name="udfps_burn_in_offset_y">8dp</dimen> direction that elements are moved to prevent burn-in on AOD--> <dimen name="udfps_burn_in_offset_x">7px</dimen> <dimen name="udfps_burn_in_offset_y">28px</dimen> <dimen name="corner_size">8dp</dimen> <dimen name="top_padding">0dp</dimen> Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +35 −3 Original line number Diff line number Diff line Loading @@ -72,13 +72,16 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS * Clock for both small and large sizes */ private AnimatableClockController mClockViewController; private FrameLayout mClockFrame; private FrameLayout mClockFrame; // top aligned clock private AnimatableClockController mLargeClockViewController; private FrameLayout mLargeClockFrame; private FrameLayout mLargeClockFrame; // centered clock private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final KeyguardBypassController mBypassController; private int mLargeClockTopMargin = 0; private int mKeyguardClockTopMargin = 0; /** * Listener for changes to the color palette. * Loading Loading @@ -177,6 +180,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } mColorExtractor.addOnColorsChangedListener(mColorsListener); mView.updateColors(getGradientColors()); mKeyguardClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); if (mOnlyClock) { View ksa = mView.findViewById(R.id.keyguard_status_area); Loading Loading @@ -241,6 +246,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS */ public void onDensityOrFontScaleChanged() { mView.onDensityOrFontScaleChanged(); mKeyguardClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); updateClockLayout(); } Loading @@ -249,9 +256,12 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS if (mSmartspaceController.isEnabled()) { RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT); lp.topMargin = getContext().getResources().getDimensionPixelSize( mLargeClockTopMargin = getContext().getResources().getDimensionPixelSize( R.dimen.keyguard_large_clock_top_margin); lp.topMargin = mLargeClockTopMargin; mLargeClockFrame.setLayoutParams(lp); } else { mLargeClockTopMargin = 0; } } Loading Loading @@ -363,6 +373,28 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } } /** * Get y-bottom position of the currently visible clock on the keyguard. * We can't directly getBottom() because clock changes positions in AOD for burn-in */ int getClockBottom(int statusBarHeaderHeight) { if (mLargeClockFrame.getVisibility() == View.VISIBLE) { View clock = mLargeClockFrame.findViewById( com.android.systemui.R.id.animatable_clock_view_large); int frameHeight = mLargeClockFrame.getHeight(); int clockHeight = clock.getHeight(); return frameHeight / 2 + clockHeight / 2; } else { return mClockFrame.findViewById( com.android.systemui.R.id.animatable_clock_view).getHeight() + statusBarHeaderHeight + mKeyguardClockTopMargin; } } boolean isClockTopAligned() { return mLargeClockFrame.getVisibility() != View.VISIBLE; } private void updateAodIcons() { NotificationIconContainer nic = (NotificationIconContainer) mView.findViewById( Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +14 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,20 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV return mView.getHeight() - mKeyguardClockSwitchController.getNotificationIconAreaHeight(); } /** * Get y-bottom position of the currently visible clock. */ public int getClockBottom(int statusBarHeaderHeight) { return mKeyguardClockSwitchController.getClockBottom(statusBarHeaderHeight); } /** * @return true if the currently displayed clock is top aligned (as opposed to center aligned) */ public boolean isClockTopAligned() { return mKeyguardClockSwitchController.isClockTopAligned(); } /** * Set whether the view accessibility importance mode. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +67 −6 Original line number Diff line number Diff line Loading @@ -56,6 +56,21 @@ public class KeyguardClockPositionAlgorithm { */ private int mUserSwitchPreferredY; /** * Whether or not there is a custom clock face on keyguard. */ private boolean mHasCustomClock; /** * Whether or not the NSSL contains any visible notifications. */ private boolean mHasVisibleNotifs; /** * Height of notification stack: Sum of height of each notification. */ private int mNotificationStackHeight; /** * Minimum top margin to avoid overlap with status bar, lock icon, or multi-user switcher * avatar. Loading Loading @@ -112,6 +127,25 @@ public class KeyguardClockPositionAlgorithm { private boolean mIsSplitShade; /** * Top location of the udfps icon. This includes the worst case (highest) burn-in * offset that would make the top physically highest on the screen. * * Set to -1 if udfps is not enrolled on the device. */ private float mUdfpsTop; /** * Bottom y-position of the currently visible clock */ private float mClockBottom; /** * If true, try to keep clock aligned to the top of the display. Else, assume the clock * is center aligned. */ private boolean mIsClockTopAligned; /** * Refreshes the dimension values. */ Loading @@ -120,7 +154,7 @@ public class KeyguardClockPositionAlgorithm { R.dimen.keyguard_status_view_bottom_margin); mContainerTopPadding = res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) / 2; res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); mBurnInPreventionOffsetX = res.getDimensionPixelSize( R.dimen.burn_in_prevention_offset_x); mBurnInPreventionOffsetYClock = res.getDimensionPixelSize( Loading @@ -134,7 +168,7 @@ public class KeyguardClockPositionAlgorithm { int keyguardStatusHeight, int userSwitchHeight, int userSwitchPreferredY, float dark, float overStretchAmount, boolean bypassEnabled, int unlockedStackScrollerPadding, float qsExpansion, int cutoutTopInset, boolean isSplitShade) { boolean isSplitShade, float udfpsTop, float clockBottom, boolean isClockTopAligned) { mMinTopMargin = keyguardStatusBarHeaderHeight + Math.max(mContainerTopPadding, userSwitchHeight); mPanelExpansion = panelExpansion; Loading @@ -148,6 +182,9 @@ public class KeyguardClockPositionAlgorithm { mQsExpansion = qsExpansion; mCutoutTopInset = cutoutTopInset; mIsSplitShade = isSplitShade; mUdfpsTop = udfpsTop; mClockBottom = clockBottom; mIsClockTopAligned = isClockTopAligned; } public void run(Result result) { Loading Loading @@ -202,8 +239,34 @@ public class KeyguardClockPositionAlgorithm { if (clockY - mBurnInPreventionOffsetYClock < mCutoutTopInset) { shift = mCutoutTopInset - (clockY - mBurnInPreventionOffsetYClock); } float clockYDark = clockY + burnInPreventionOffsetY() + shift; int burnInPreventionOffsetY = mBurnInPreventionOffsetYClock; // requested offset final boolean hasUdfps = mUdfpsTop > -1; if (hasUdfps && !mIsClockTopAligned) { // ensure clock doesn't overlap with the udfps icon if (mUdfpsTop < mClockBottom) { // sometimes the clock textView extends beyond udfps, so let's just use the // space above the KeyguardStatusView/clock as our burn-in offset burnInPreventionOffsetY = (int) (clockY - mCutoutTopInset) / 2; if (mBurnInPreventionOffsetYClock < burnInPreventionOffsetY) { burnInPreventionOffsetY = mBurnInPreventionOffsetYClock; } shift = -burnInPreventionOffsetY; } else { float upperSpace = clockY - mCutoutTopInset; float lowerSpace = mUdfpsTop - mClockBottom; // center the burn-in offset within the upper + lower space burnInPreventionOffsetY = (int) (lowerSpace + upperSpace) / 2; if (mBurnInPreventionOffsetYClock < burnInPreventionOffsetY) { burnInPreventionOffsetY = mBurnInPreventionOffsetYClock; } shift = (lowerSpace - upperSpace) / 2; } } float clockYDark = clockY + burnInPreventionOffsetY(burnInPreventionOffsetY) + shift; return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mOverStretchAmount); } Loading Loading @@ -235,9 +298,7 @@ public class KeyguardClockPositionAlgorithm { return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount); } private float burnInPreventionOffsetY() { int offset = mBurnInPreventionOffsetYClock; private float burnInPreventionOffsetY(int offset) { return getBurnInOffset(offset * 2, false /* xAxis */) - offset; } Loading Loading
packages/SystemUI/res/values-h800dp/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ <resources> <!-- Minimum margin between clock and top of screen or ambient indication --> <dimen name="keyguard_clock_top_margin">76dp</dimen> <dimen name="keyguard_clock_top_margin">38dp</dimen> <!-- Large clock maximum font size (dp is intentional, to prevent any further scaling) --> <dimen name="large_clock_text_size">200dp</dimen> Loading
packages/SystemUI/res/values/dimens.xml +4 −6 Original line number Diff line number Diff line Loading @@ -750,9 +750,7 @@ <!-- The margin between the status view and the notifications on Keyguard.--> <dimen name="keyguard_status_view_bottom_margin">20dp</dimen> <!-- Minimum margin between clock and status bar --> <dimen name="keyguard_clock_top_margin">36dp</dimen> <!-- The margin between top of clock and bottom of lock icon. --> <dimen name="keyguard_clock_lock_margin">16dp</dimen> <dimen name="keyguard_clock_top_margin">18dp</dimen> <!-- The amount to shift the clocks during a small/large transition --> <dimen name="keyguard_clock_switch_y_shift">10dp</dimen> <!-- When large clock is showing, offset the smartspace by this amount --> Loading Loading @@ -1157,9 +1155,9 @@ <dimen name="default_burn_in_prevention_offset">15dp</dimen> <!-- The maximum offset for the under-display fingerprint sensor (UDFPS) icon in either direction that elements aer moved to prevent burn-in on AOD--> <dimen name="udfps_burn_in_offset_x">2dp</dimen> <dimen name="udfps_burn_in_offset_y">8dp</dimen> direction that elements are moved to prevent burn-in on AOD--> <dimen name="udfps_burn_in_offset_x">7px</dimen> <dimen name="udfps_burn_in_offset_y">28px</dimen> <dimen name="corner_size">8dp</dimen> <dimen name="top_padding">0dp</dimen> Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +35 −3 Original line number Diff line number Diff line Loading @@ -72,13 +72,16 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS * Clock for both small and large sizes */ private AnimatableClockController mClockViewController; private FrameLayout mClockFrame; private FrameLayout mClockFrame; // top aligned clock private AnimatableClockController mLargeClockViewController; private FrameLayout mLargeClockFrame; private FrameLayout mLargeClockFrame; // centered clock private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final KeyguardBypassController mBypassController; private int mLargeClockTopMargin = 0; private int mKeyguardClockTopMargin = 0; /** * Listener for changes to the color palette. * Loading Loading @@ -177,6 +180,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } mColorExtractor.addOnColorsChangedListener(mColorsListener); mView.updateColors(getGradientColors()); mKeyguardClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); if (mOnlyClock) { View ksa = mView.findViewById(R.id.keyguard_status_area); Loading Loading @@ -241,6 +246,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS */ public void onDensityOrFontScaleChanged() { mView.onDensityOrFontScaleChanged(); mKeyguardClockTopMargin = mView.getResources().getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); updateClockLayout(); } Loading @@ -249,9 +256,12 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS if (mSmartspaceController.isEnabled()) { RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT); lp.topMargin = getContext().getResources().getDimensionPixelSize( mLargeClockTopMargin = getContext().getResources().getDimensionPixelSize( R.dimen.keyguard_large_clock_top_margin); lp.topMargin = mLargeClockTopMargin; mLargeClockFrame.setLayoutParams(lp); } else { mLargeClockTopMargin = 0; } } Loading Loading @@ -363,6 +373,28 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } } /** * Get y-bottom position of the currently visible clock on the keyguard. * We can't directly getBottom() because clock changes positions in AOD for burn-in */ int getClockBottom(int statusBarHeaderHeight) { if (mLargeClockFrame.getVisibility() == View.VISIBLE) { View clock = mLargeClockFrame.findViewById( com.android.systemui.R.id.animatable_clock_view_large); int frameHeight = mLargeClockFrame.getHeight(); int clockHeight = clock.getHeight(); return frameHeight / 2 + clockHeight / 2; } else { return mClockFrame.findViewById( com.android.systemui.R.id.animatable_clock_view).getHeight() + statusBarHeaderHeight + mKeyguardClockTopMargin; } } boolean isClockTopAligned() { return mLargeClockFrame.getVisibility() != View.VISIBLE; } private void updateAodIcons() { NotificationIconContainer nic = (NotificationIconContainer) mView.findViewById( Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +14 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,20 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV return mView.getHeight() - mKeyguardClockSwitchController.getNotificationIconAreaHeight(); } /** * Get y-bottom position of the currently visible clock. */ public int getClockBottom(int statusBarHeaderHeight) { return mKeyguardClockSwitchController.getClockBottom(statusBarHeaderHeight); } /** * @return true if the currently displayed clock is top aligned (as opposed to center aligned) */ public boolean isClockTopAligned() { return mKeyguardClockSwitchController.isClockTopAligned(); } /** * Set whether the view accessibility importance mode. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +67 −6 Original line number Diff line number Diff line Loading @@ -56,6 +56,21 @@ public class KeyguardClockPositionAlgorithm { */ private int mUserSwitchPreferredY; /** * Whether or not there is a custom clock face on keyguard. */ private boolean mHasCustomClock; /** * Whether or not the NSSL contains any visible notifications. */ private boolean mHasVisibleNotifs; /** * Height of notification stack: Sum of height of each notification. */ private int mNotificationStackHeight; /** * Minimum top margin to avoid overlap with status bar, lock icon, or multi-user switcher * avatar. Loading Loading @@ -112,6 +127,25 @@ public class KeyguardClockPositionAlgorithm { private boolean mIsSplitShade; /** * Top location of the udfps icon. This includes the worst case (highest) burn-in * offset that would make the top physically highest on the screen. * * Set to -1 if udfps is not enrolled on the device. */ private float mUdfpsTop; /** * Bottom y-position of the currently visible clock */ private float mClockBottom; /** * If true, try to keep clock aligned to the top of the display. Else, assume the clock * is center aligned. */ private boolean mIsClockTopAligned; /** * Refreshes the dimension values. */ Loading @@ -120,7 +154,7 @@ public class KeyguardClockPositionAlgorithm { R.dimen.keyguard_status_view_bottom_margin); mContainerTopPadding = res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) / 2; res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin); mBurnInPreventionOffsetX = res.getDimensionPixelSize( R.dimen.burn_in_prevention_offset_x); mBurnInPreventionOffsetYClock = res.getDimensionPixelSize( Loading @@ -134,7 +168,7 @@ public class KeyguardClockPositionAlgorithm { int keyguardStatusHeight, int userSwitchHeight, int userSwitchPreferredY, float dark, float overStretchAmount, boolean bypassEnabled, int unlockedStackScrollerPadding, float qsExpansion, int cutoutTopInset, boolean isSplitShade) { boolean isSplitShade, float udfpsTop, float clockBottom, boolean isClockTopAligned) { mMinTopMargin = keyguardStatusBarHeaderHeight + Math.max(mContainerTopPadding, userSwitchHeight); mPanelExpansion = panelExpansion; Loading @@ -148,6 +182,9 @@ public class KeyguardClockPositionAlgorithm { mQsExpansion = qsExpansion; mCutoutTopInset = cutoutTopInset; mIsSplitShade = isSplitShade; mUdfpsTop = udfpsTop; mClockBottom = clockBottom; mIsClockTopAligned = isClockTopAligned; } public void run(Result result) { Loading Loading @@ -202,8 +239,34 @@ public class KeyguardClockPositionAlgorithm { if (clockY - mBurnInPreventionOffsetYClock < mCutoutTopInset) { shift = mCutoutTopInset - (clockY - mBurnInPreventionOffsetYClock); } float clockYDark = clockY + burnInPreventionOffsetY() + shift; int burnInPreventionOffsetY = mBurnInPreventionOffsetYClock; // requested offset final boolean hasUdfps = mUdfpsTop > -1; if (hasUdfps && !mIsClockTopAligned) { // ensure clock doesn't overlap with the udfps icon if (mUdfpsTop < mClockBottom) { // sometimes the clock textView extends beyond udfps, so let's just use the // space above the KeyguardStatusView/clock as our burn-in offset burnInPreventionOffsetY = (int) (clockY - mCutoutTopInset) / 2; if (mBurnInPreventionOffsetYClock < burnInPreventionOffsetY) { burnInPreventionOffsetY = mBurnInPreventionOffsetYClock; } shift = -burnInPreventionOffsetY; } else { float upperSpace = clockY - mCutoutTopInset; float lowerSpace = mUdfpsTop - mClockBottom; // center the burn-in offset within the upper + lower space burnInPreventionOffsetY = (int) (lowerSpace + upperSpace) / 2; if (mBurnInPreventionOffsetYClock < burnInPreventionOffsetY) { burnInPreventionOffsetY = mBurnInPreventionOffsetYClock; } shift = (lowerSpace - upperSpace) / 2; } } float clockYDark = clockY + burnInPreventionOffsetY(burnInPreventionOffsetY) + shift; return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mOverStretchAmount); } Loading Loading @@ -235,9 +298,7 @@ public class KeyguardClockPositionAlgorithm { return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount); } private float burnInPreventionOffsetY() { int offset = mBurnInPreventionOffsetYClock; private float burnInPreventionOffsetY(int offset) { return getBurnInOffset(offset * 2, false /* xAxis */) - offset; } Loading