diff options
author | Shan Huang <shanh@google.com> | 2021-06-29 12:12:28 +0800 |
---|---|---|
committer | Shan Huang <shanh@google.com> | 2021-06-29 12:15:10 +0800 |
commit | be2073710854306b10e0fdb611a485d2c23f0500 (patch) | |
tree | 4180257fc474c3437d50703a5146e83edfbfe08f /packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java | |
parent | d87df18092cb926d6ca2e605848f70b81778d9ce (diff) |
Fix clock font weight animation to always match the latest doze state.
Bug:189296201
Fixes:189296201
Test: Turn off AOD, put screen off, plugin charger, checks the font
weight after phone wakes up.
Change-Id: I1206efbf213e6fbbfddfc2eb884f66a9321bf993
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java b/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java index 63867c0f7308..58b3865facbc 100644 --- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java +++ b/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java @@ -196,20 +196,20 @@ public class AnimatableClockView extends TextView { null /* onAnimationEnd */); } - void animateCharge(boolean isDozing) { + void animateCharge(DozeStateGetter dozeStateGetter) { if (mTextAnimator == null || mTextAnimator.isRunning()) { // Skip charge animation if dozing animation is already playing. return; } Runnable startAnimPhase2 = () -> setTextStyle( - isDozing ? mDozingWeight : mLockScreenWeight/* weight */, + dozeStateGetter.isDozing() ? mDozingWeight : mLockScreenWeight/* weight */, -1, null, true /* animate */, CHARGE_ANIM_DURATION_PHASE_1, 0 /* delay */, null /* onAnimationEnd */); - setTextStyle(isDozing ? mLockScreenWeight : mDozingWeight/* weight */, + setTextStyle(dozeStateGetter.isDozing() ? mLockScreenWeight : mDozingWeight/* weight */, -1, null, true /* animate */, @@ -279,4 +279,8 @@ public class AnimatableClockView extends TextView { context.getResources().getConfiguration().locale); return dtpg.getBestPattern(skeleton); } + + interface DozeStateGetter { + boolean isDozing(); + } } |