diff options
| author | Beverly <beverlyt@google.com> | 2020-12-01 09:00:57 -0500 |
|---|---|---|
| committer | Beverly Tai <beverlyt@google.com> | 2020-12-03 14:09:35 +0000 |
| commit | e1b6d7f819a892b650f61db5ad5c0621e2b80f06 (patch) | |
| tree | c8a843352588d4c92255f3a802b0642af7b254b4 /packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | |
| parent | 648d4e5e005f2a1422d5e8f8cf7bd4d9c93639e0 (diff) | |
Update AOD/LS clock
- Update clock sizes (large clock = 200dp, small clock = 100dp)
- Update clock weights (large = 100-400, small = 200-300)
- Update clocks on time zone and time format changes
(Settings > System > Date & Time)
Test: manual, atest SystemUITests
Bug: 170228350
Change-Id: I446a2625fdd776c15e744f1601b3ea0e2a873cf1
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java')
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index 829ff9771fb4..4d6e8a90e57b 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -17,7 +17,9 @@ package com.android.keyguard; import android.app.WallpaperManager; +import android.content.ContentResolver; import android.content.res.Resources; +import android.provider.Settings; import android.text.format.DateFormat; import android.util.TypedValue; import android.view.View; @@ -90,6 +92,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS }; private ClockManager.ClockChangedListener mClockChangedListener = this::setClockPlugin; + private String mTimeFormat; @Inject public KeyguardClockSwitchController( @@ -98,7 +101,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS StatusBarStateController statusBarStateController, SysuiColorExtractor colorExtractor, ClockManager clockManager, KeyguardSliceViewController keyguardSliceViewController, - NotificationIconAreaController notificationIconAreaController) { + NotificationIconAreaController notificationIconAreaController, + ContentResolver contentResolver) { super(keyguardClockSwitch); mResources = resources; mStatusBarStateController = statusBarStateController; @@ -106,6 +110,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mClockManager = clockManager; mKeyguardSliceViewController = keyguardSliceViewController; mNotificationIconAreaController = notificationIconAreaController; + mTimeFormat = Settings.System.getString(contentResolver, Settings.System.TIME_12_24); } /** @@ -246,12 +251,26 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS void updateTimeZone(TimeZone timeZone) { mView.onTimeZoneChanged(timeZone); + if (mNewLockScreenClockViewController != null) { + mNewLockScreenClockViewController.onTimeZoneChanged(timeZone); + mNewLockScreenLargeClockViewController.onTimeZoneChanged(timeZone); + } } - void refreshFormat() { + void refreshFormat(String timeFormat) { + mTimeFormat = timeFormat; Patterns.update(mResources); mView.setFormat12Hour(Patterns.sClockView12); mView.setFormat24Hour(Patterns.sClockView24); + mView.onTimeFormatChanged(mTimeFormat); + if (mNewLockScreenClockViewController != null) { + mNewLockScreenClockViewController.refreshFormat(); + mNewLockScreenLargeClockViewController.refreshFormat(); + } + } + + void refreshFormat() { + refreshFormat(mTimeFormat); } float getClockTextTopPadding() { |
