diff options
author | Brian Orr <brianorr@google.com> | 2021-06-15 12:47:53 -0700 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-06-17 13:37:54 -0700 |
commit | 71c831703ae59baf47e0afe611fecd714c481cdf (patch) | |
tree | 06731a987032723085b9e1a65951cf96abbc19cf /packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java | |
parent | 065c9e9a6e9d61d4383a91721eb56a3de253bdbe (diff) | |
parent | 81833820d54b9a6b27894f9f8dfd72222d416992 (diff) |
Merge SP1A.210604.001
Change-Id: I5200ee05285ae422d5e9c1c00f45709a5d6188be
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java index 3a3f2fc40b25..e8cc5c8a49f3 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java @@ -20,11 +20,14 @@ import android.graphics.Rect; import android.os.UserHandle; import android.util.Slog; +import com.android.systemui.keyguard.KeyguardUnlockAnimationController; +import com.android.systemui.shared.system.smartspace.SmartspaceTransitionController; import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.notification.stack.AnimationProperties; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.phone.DozeParameters; +import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; @@ -49,6 +52,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private final ConfigurationController mConfigurationController; private final DozeParameters mDozeParameters; private final KeyguardVisibilityHelper mKeyguardVisibilityHelper; + private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; + private final KeyguardStateController mKeyguardStateController; + private SmartspaceTransitionController mSmartspaceTransitionController; private final Rect mClipBounds = new Rect(); @Inject @@ -59,15 +65,33 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV KeyguardStateController keyguardStateController, KeyguardUpdateMonitor keyguardUpdateMonitor, ConfigurationController configurationController, - DozeParameters dozeParameters) { + DozeParameters dozeParameters, + KeyguardUnlockAnimationController keyguardUnlockAnimationController, + SmartspaceTransitionController smartspaceTransitionController, + UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) { super(keyguardStatusView); mKeyguardSliceViewController = keyguardSliceViewController; mKeyguardClockSwitchController = keyguardClockSwitchController; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mConfigurationController = configurationController; mDozeParameters = dozeParameters; + mKeyguardStateController = keyguardStateController; mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController, - dozeParameters); + dozeParameters, unlockedScreenOffAnimationController); + mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; + mSmartspaceTransitionController = smartspaceTransitionController; + + mKeyguardStateController.addCallback(new KeyguardStateController.Callback() { + @Override + public void onKeyguardShowingChanged() { + // If we explicitly re-show the keyguard, make sure that all the child views are + // visible. They might have been animating out as part of the SmartSpace shared + // element transition. + if (keyguardStateController.isShowing()) { + mView.setChildrenAlphaExcludingClockView(1f); + } + } + }); } @Override @@ -137,7 +161,24 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV */ public void setAlpha(float alpha) { if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) { - mView.setAlpha(alpha); + // If we're capable of performing the SmartSpace shared element transition, and we are + // going to (we're swiping to dismiss vs. bringing up the PIN screen), then fade out + // everything except for the SmartSpace. + if (mKeyguardUnlockAnimationController.isUnlockingWithSmartSpaceTransition()) { + mView.setChildrenAlphaExcludingClockView(alpha); + mKeyguardClockSwitchController.setChildrenAlphaExcludingSmartspace(alpha); + } else if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) { + // Otherwise, we can just set the alpha for the entire container. + mView.setAlpha(alpha); + + // If we previously unlocked with the shared element transition, some child views + // might still have alpha = 0f. Set them back to 1f since we're just using the + // parent container's alpha. + if (mView.getChildrenAlphaExcludingSmartSpace() < 1f) { + mView.setChildrenAlphaExcludingClockView(1f); + mKeyguardClockSwitchController.setChildrenAlphaExcludingSmartspace(1f); + } + } } } |