diff options
author | Matt Pietal <mpietal@google.com> | 2020-12-01 10:52:28 -0500 |
---|---|---|
committer | Matt Pietal <mpietal@google.com> | 2020-12-01 11:00:58 -0500 |
commit | 60028e89fcd03d22e1e431556686d82c34b06b9c (patch) | |
tree | 3078baba2b01075d2b4c83de860572b48f054dcd /packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | |
parent | 3a9b54f70487cd139c9c4d1bf740cf30a3564aba (diff) |
AOD - Scale large clock for burn-in protection
Scale the AOD large clock between [0.8, 1.0] in both x,y directions,
in order to keep the clock centered. The large clock will still be
shifted on the y-axis as well.
Bug: 13129102
Test: manual, burn in tests
Change-Id: I86235d39b199a1a10cfb40e474f1e1e58b9c11d8
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index c5c36e920d45..829ff9771fb4 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -62,6 +62,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private AnimatableClockController mNewLockScreenClockViewController; private FrameLayout mNewLockScreenClockFrame; private AnimatableClockController mNewLockScreenLargeClockViewController; + private FrameLayout mNewLockScreenLargeClockFrame; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; @@ -126,6 +127,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.updateColors(getGradientColors()); updateAodIcons(); mNewLockScreenClockFrame = mView.findViewById(R.id.new_lockscreen_clock_view); + mNewLockScreenLargeClockFrame = mView.findViewById(R.id.new_lockscreen_clock_view_large); } @Override @@ -199,13 +201,18 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS /** * Update position of the view, with optional animation. Move the slice view and the clock * slightly towards the center in order to prevent burn-in. Y positioning occurs at the - * view parent level. + * view parent level. The large clock view will scale instead of using x position offsets, to + * keep the clock centered. */ - void updatePosition(int x, AnimationProperties props, boolean animate) { + void updatePosition(int x, float scale, AnimationProperties props, boolean animate) { x = Math.abs(x); if (mNewLockScreenClockFrame != null) { PropertyAnimator.setProperty(mNewLockScreenClockFrame, AnimatableProperty.TRANSLATION_X, -x, props, animate); + PropertyAnimator.setProperty(mNewLockScreenLargeClockFrame, AnimatableProperty.SCALE_X, + scale, props, animate); + PropertyAnimator.setProperty(mNewLockScreenLargeClockFrame, AnimatableProperty.SCALE_Y, + scale, props, animate); } mKeyguardSliceViewController.updatePosition(x, props, animate); mNotificationIconAreaController.updatePosition(x, props, animate); |