From f18b2894e4a4cd1f27ec1026bd13fc84c6a4b15c Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 14 May 2021 16:03:46 -0400 Subject: Consider the clock detached if the keyguard isn't visible Update AnimatableClockController's definition of attached to include whether the keyguard is visible or not. This way, we won't animate if the view isn't actually visible & we'll reset the clock state when the keyguard is newly visible. Only create a new AnimatableClockController onInit instead of in the onAttach method for KeyguardClockSwitchController. Fixes: 188203771 Test: manual Change-Id: Id02132dba8b5392046cb46766aa64fd58e04a4ad --- .../keyguard/AnimatableClockController.java | 83 ++++++++++++++++------ 1 file changed, 60 insertions(+), 23 deletions(-) (limited to 'packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java') diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java index 4b9bf8c27f8a..e6ec04b4e391 100644 --- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java +++ b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java @@ -37,7 +37,8 @@ import java.util.Objects; import java.util.TimeZone; /** - * Controller for an AnimatableClockView. Instantiated by {@link KeyguardClockSwitchController}. + * Controller for an AnimatableClockView on the keyguard. Instantiated by + * {@link KeyguardClockSwitchController}. */ public class AnimatableClockController extends ViewController { private static final int FORMAT_NUMBER = 1234567890; @@ -46,6 +47,7 @@ public class AnimatableClockController extends ViewController