diff options
author | Matt Pietal <mpietal@google.com> | 2021-06-30 08:32:11 -0400 |
---|---|---|
committer | Matt Pietal <mpietal@google.com> | 2021-06-30 11:03:12 -0400 |
commit | 969616a0bdf62b8a4ed792158d29f4c870a3ccc8 (patch) | |
tree | ee5447b01d925ab3b0cb8491a8382e454ae1fd83 /packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | |
parent | 18ec43f7f78c510f64a9f1012b0d3749e73987cb (diff) |
Large clock positioning
- Better position the large clock to support various display
sizes. Specs call for centering minus a slight adjustment vertically.
- Make sure notifications don't run into the indication area. The
prior padding was too small.
- Ensure a smooth transition between lockscreen and bouncer
- Fix the smartspace with large clock to not interfere with the dock
settings icon
Fixes: 190047134
Test: manual (all display sizes)
Change-Id: I89e35eef35dc1d3d609b381f768779226962585f
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index a28d1747f2fe..781f34bfb195 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -189,10 +189,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS .getDimensionPixelSize(R.dimen.below_clock_padding_end); mSmartspaceView.setPaddingRelative(startPadding, 0, endPadding, 0); - // ... but above the large clock - lp = new RelativeLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT); - lp.addRule(RelativeLayout.BELOW, mSmartspaceView.getId()); - mLargeClockFrame.setLayoutParams(lp); + updateClockLayout(); View nic = mView.findViewById( R.id.left_aligned_notification_icon_container); @@ -235,6 +232,18 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS */ public void onDensityOrFontScaleChanged() { mView.onDensityOrFontScaleChanged(); + + updateClockLayout(); + } + + private void updateClockLayout() { + if (mSmartspaceController.isEnabled()) { + RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT, + MATCH_PARENT); + lp.topMargin = getContext().getResources().getDimensionPixelSize( + R.dimen.keyguard_large_clock_top_margin); + mLargeClockFrame.setLayoutParams(lp); + } } /** |