diff options
4 files changed, 27 insertions, 19 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java index e30fdfe56956..123c0e63d7d1 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java @@ -76,7 +76,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV mDozeParameters = dozeParameters; mKeyguardStateController = keyguardStateController; mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController, - dozeParameters, unlockedScreenOffAnimationController); + dozeParameters, unlockedScreenOffAnimationController, /* animateYPos= */ true); mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mSmartspaceTransitionController = smartspaceTransitionController; diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardVisibilityHelper.java b/packages/SystemUI/src/com/android/keyguard/KeyguardVisibilityHelper.java index 7edecc80a27e..28a54d56b071 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardVisibilityHelper.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardVisibilityHelper.java @@ -19,6 +19,7 @@ package com.android.keyguard; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import android.view.View; +import android.view.ViewPropertyAnimator; import com.android.systemui.animation.Interpolators; import com.android.systemui.statusbar.StatusBarState; @@ -40,6 +41,7 @@ public class KeyguardVisibilityHelper { private final KeyguardStateController mKeyguardStateController; private final DozeParameters mDozeParameters; private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; + private boolean mAnimateYPos; private boolean mKeyguardViewVisibilityAnimating; private boolean mLastOccludedState = false; private final AnimationProperties mAnimationProperties = new AnimationProperties(); @@ -47,11 +49,13 @@ public class KeyguardVisibilityHelper { public KeyguardVisibilityHelper(View view, KeyguardStateController keyguardStateController, DozeParameters dozeParameters, - UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) { + UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, + boolean animateYPos) { mView = view; mKeyguardStateController = keyguardStateController; mDozeParameters = dozeParameters; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; + mAnimateYPos = animateYPos; } public boolean isVisibilityAnimating() { @@ -98,23 +102,25 @@ public class KeyguardVisibilityHelper { } else if (statusBarState == KEYGUARD) { if (keyguardFadingAway) { mKeyguardViewVisibilityAnimating = true; - float target = mView.getY() - mView.getHeight() * 0.05f; - int delay = 0; - int duration = 125; - // We animate the Y properly separately using the PropertyAnimator, as the panel - // view als needs to update the end position. - mAnimationProperties.setDuration(duration).setDelay(delay); - PropertyAnimator.cancelAnimation(mView, AnimatableProperty.Y); - PropertyAnimator.setProperty(mView, AnimatableProperty.Y, target, - mAnimationProperties, - true /* animate */); - mView.animate() + ViewPropertyAnimator animator = mView.animate() .alpha(0) .setInterpolator(Interpolators.FAST_OUT_LINEAR_IN) - .setDuration(duration) - .setStartDelay(delay) - .withEndAction(mAnimateKeyguardStatusViewInvisibleEndRunnable) - .start(); + .withEndAction(mAnimateKeyguardStatusViewInvisibleEndRunnable); + if (mAnimateYPos) { + float target = mView.getY() - mView.getHeight() * 0.05f; + int delay = 0; + int duration = 125; + // We animate the Y property separately using the PropertyAnimator, as the panel + // view also needs to update the end position. + mAnimationProperties.setDuration(duration).setDelay(delay); + PropertyAnimator.cancelAnimation(mView, AnimatableProperty.Y); + PropertyAnimator.setProperty(mView, AnimatableProperty.Y, target, + mAnimationProperties, + true /* animate */); + animator.setDuration(duration) + .setStartDelay(delay); + } + animator.start(); } else if (mLastOccludedState && !isOccluded) { // An activity was displayed over the lock screen, and has now gone away mView.setVisibility(View.VISIBLE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java index 2ecd4b3db5a1..1f1817cd29f0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java @@ -137,7 +137,8 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie mConfigurationController = configurationController; mStatusBarStateController = statusBarStateController; mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, - keyguardStateController, dozeParameters, unlockedScreenOffAnimationController); + keyguardStateController, dozeParameters, + unlockedScreenOffAnimationController, /* animateYPos= */ false); mUserDetailAdapter = new KeyguardUserDetailAdapter(context, userDetailViewAdapterProvider); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java index 68f2a62a4fec..43b2061ecd32 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java @@ -173,7 +173,8 @@ public class KeyguardUserSwitcherController extends ViewController<KeyguardUserS mAdapter = new KeyguardUserAdapter(mContext, resources, layoutInflater, mUserSwitcherController, this); mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, - keyguardStateController, dozeParameters, unlockedScreenOffAnimationController); + keyguardStateController, dozeParameters, + unlockedScreenOffAnimationController, /* animateYPos= */ false); mBackground = new KeyguardUserSwitcherScrim(context); } |