From 58adc76595d1e66c1fe4d9a071f1ade25392654d Mon Sep 17 00:00:00 2001 From: Darrell Shi Date: Thu, 20 Oct 2022 17:40:19 +0000 Subject: [PATCH] Change dream IN animation duration to 250ms. This change adds a framework level config for dream IN/OUT animation durations that is shared by the animation xml and keyguard view mediator to ensure wherever the dream is launched, it has a consistent launch animation duration. The dream IN duration has been changed to 250ms from previously 1000ms to match specs. Bug: 222507937 Test: observe dream IN animation over launcher Test: observe dream IN animation over keyguard Change-Id: I5a51406f8476a76131b6c1aeeb89d12bd43a5a17 --- core/res/res/anim/dream_activity_close_exit.xml | 2 +- core/res/res/anim/dream_activity_open_enter.xml | 2 +- core/res/res/anim/dream_activity_open_exit.xml | 2 +- core/res/res/values/config.xml | 5 +++++ core/res/res/values/symbols.xml | 2 ++ .../systemui/keyguard/KeyguardViewMediator.java | 11 +++++++++-- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/core/res/res/anim/dream_activity_close_exit.xml b/core/res/res/anim/dream_activity_close_exit.xml index c4599dad31a06..8df624fdd2e5a 100644 --- a/core/res/res/anim/dream_activity_close_exit.xml +++ b/core/res/res/anim/dream_activity_close_exit.xml @@ -19,5 +19,5 @@ + android:duration="@integer/config_dreamCloseAnimationDuration" /> diff --git a/core/res/res/anim/dream_activity_open_enter.xml b/core/res/res/anim/dream_activity_open_enter.xml index 9e1c6e2ee0d72..d6d9c5c990f89 100644 --- a/core/res/res/anim/dream_activity_open_enter.xml +++ b/core/res/res/anim/dream_activity_open_enter.xml @@ -22,5 +22,5 @@ those two has to be the same. --> + android:duration="@integer/config_dreamOpenAnimationDuration" /> diff --git a/core/res/res/anim/dream_activity_open_exit.xml b/core/res/res/anim/dream_activity_open_exit.xml index 740f52856b7f0..2c2e501eda69b 100644 --- a/core/res/res/anim/dream_activity_open_exit.xml +++ b/core/res/res/anim/dream_activity_open_exit.xml @@ -22,4 +22,4 @@ dream_activity_open_enter animation. --> + android:duration="@integer/config_dreamOpenAnimationDuration" /> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 4191ab9691d1a..881d499917203 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2482,6 +2482,11 @@ false + + 250 + + 100 + false diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 5897e3af67fcc..7a7b43a3632ac 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2237,6 +2237,8 @@ + + diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index a3632705d865d..c8370b4be6f8e 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -400,6 +400,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private final float mPowerButtonY; private final float mWindowCornerRadius; + /** + * The duration in milliseconds of the dream open animation. + */ + private final int mDreamOpenAnimationDuration; + /** * The animation used for hiding keyguard. This is used to fetch the animation timings if * WindowManager is not providing us with them. @@ -946,8 +951,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } mOccludeByDreamAnimator = ValueAnimator.ofFloat(0f, 1f); - // Use the same duration as for the UNOCCLUDE. - mOccludeByDreamAnimator.setDuration(UNOCCLUDE_ANIMATION_DURATION); + mOccludeByDreamAnimator.setDuration(mDreamOpenAnimationDuration); mOccludeByDreamAnimator.setInterpolator(Interpolators.LINEAR); mOccludeByDreamAnimator.addUpdateListener( animation -> { @@ -1179,6 +1183,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mPowerButtonY = context.getResources().getDimensionPixelSize( R.dimen.physical_power_button_center_screen_location_y); mWindowCornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(context); + + mDreamOpenAnimationDuration = context.getResources().getInteger( + com.android.internal.R.integer.config_dreamOpenAnimationDuration); } public void userActivity() {