Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +16 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,22 @@ public class KeyguardStatusView extends GridLayout { } } /** Sets a translationY value on every child view except for the media view. */ public void setChildrenTranslationYExcludingMediaView(float translationY) { setChildrenTranslationYExcluding(translationY, Set.of(mMediaHostContainer)); } /** Sets a translationY value on every view except for the views in the provided set. */ private void setChildrenTranslationYExcluding(float translationY, Set<View> excludedViews) { for (int i = 0; i < mStatusViewContainer.getChildCount(); i++) { final View child = mStatusViewContainer.getChildAt(i); if (!excludedViews.contains(child)) { child.setTranslationY(translationY); } } } public float getChildrenAlphaExcludingSmartSpace() { return mChildrenAlphaExcludingSmartSpace; } Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +7 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV return mKeyguardClockSwitchController.hasCustomClock(); } /** * Sets a translationY on the views on the keyguard, except on the media view. */ public void setTranslationYExcludingMedia(float translationY) { mView.setChildrenTranslationYExcludingMediaView(translationY); } /** * Set keyguard status view alpha. */ Loading packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +12 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,18 @@ class MediaHierarchyManager @Inject constructor( fullShadeTransitionProgress = progress } /** * Returns the amount of translationY of the media container, during the current guided * transformation, if running. If there is no guided transformation running, it will return 0. */ fun getGuidedTransformationTranslationY(): Int { if (!isCurrentlyInGuidedTransformation()) { return -1 } val startHost = getHost(previousLocation) ?: return 0 return targetBounds.top - startHost.currentBounds.top } /** * Is the shade currently collapsing from the expanded qs? If we're on the lockscreen and in qs, * we wouldn't want to transition in that case. Loading packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +17 −5 Original line number Diff line number Diff line Loading @@ -406,6 +406,7 @@ class LockscreenShadeTransitionController @Inject constructor( mediaHierarchyManager.setTransitionToFullShadeAmount(field) transitionToShadeAmountCommon(field) transitionToShadeAmountKeyguard(field) } } } Loading @@ -420,11 +421,6 @@ class LockscreenShadeTransitionController @Inject constructor( val scrimProgress = MathUtils.saturate(dragDownAmount / scrimTransitionDistance) scrimController.setTransitionToFullShadeProgress(scrimProgress) // Fade out all content only visible on the lockscreen val npvcProgress = MathUtils.saturate(dragDownAmount / npvcKeyguardContentAlphaTransitionDistance) notificationPanelController.setKeyguardOnlyContentAlpha(1.0f - npvcProgress) if (depthControllerTransitionDistance > 0) { val depthProgress = MathUtils.saturate(dragDownAmount / depthControllerTransitionDistance) Loading @@ -438,6 +434,22 @@ class LockscreenShadeTransitionController @Inject constructor( centralSurfaces.setTransitionToFullShadeProgress(statusBarProgress) } private fun transitionToShadeAmountKeyguard(dragDownAmount: Float) { // Fade out all content only visible on the lockscreen val keyguardAlphaProgress = MathUtils.saturate(dragDownAmount / npvcKeyguardContentAlphaTransitionDistance) val keyguardAlpha = 1f - keyguardAlphaProgress val keyguardTranslationY = if (useSplitShade) { // On split-shade, the translationY of the keyguard should stay in sync with the // translation of media. mediaHierarchyManager.getGuidedTransformationTranslationY() } else { 0 } notificationPanelController .setKeyguardTransitionProgress(keyguardAlpha, keyguardTranslationY) } private fun setDragDownAmountAnimated( target: Float, delay: Long = 0, Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +11 −3 Original line number Diff line number Diff line Loading @@ -616,6 +616,11 @@ public class NotificationPanelViewController extends PanelViewController { */ private float mKeyguardOnlyContentAlpha = 1.0f; /** * The translationY of the views which only show on the keyguard but in shade / shade locked. */ private int mKeyguardOnlyTransitionTranslationY = 0; private float mUdfpsMaxYBurnInOffset; /** Loading Loading @@ -1575,6 +1580,8 @@ public class NotificationPanelViewController extends PanelViewController { private void updateClock() { float alpha = mClockPositionResult.clockAlpha * mKeyguardOnlyContentAlpha; mKeyguardStatusViewController.setAlpha(alpha); mKeyguardStatusViewController .setTranslationYExcludingMedia(mKeyguardOnlyTransitionTranslationY); if (mKeyguardQsUserSwitchController != null) { mKeyguardQsUserSwitchController.setAlpha(alpha); } Loading Loading @@ -2732,11 +2739,12 @@ public class NotificationPanelViewController extends PanelViewController { } /** * Set the alpha of the keyguard elements which only show on the lockscreen, but not in * shade locked / shade. This is used when dragging down to the full shade. * Set the alpha and translationY of the keyguard elements which only show on the lockscreen, * but not in shade locked / shade. This is used when dragging down to the full shade. */ public void setKeyguardOnlyContentAlpha(float keyguardAlpha) { public void setKeyguardTransitionProgress(float keyguardAlpha, int keyguardTranslationY) { mKeyguardOnlyContentAlpha = Interpolators.ALPHA_IN.getInterpolation(keyguardAlpha); mKeyguardOnlyTransitionTranslationY = keyguardTranslationY; if (mBarState == KEYGUARD) { // If the animator is running, it's already fading out the content and this is a reset mBottomAreaShadeAlpha = mKeyguardOnlyContentAlpha; Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +16 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,22 @@ public class KeyguardStatusView extends GridLayout { } } /** Sets a translationY value on every child view except for the media view. */ public void setChildrenTranslationYExcludingMediaView(float translationY) { setChildrenTranslationYExcluding(translationY, Set.of(mMediaHostContainer)); } /** Sets a translationY value on every view except for the views in the provided set. */ private void setChildrenTranslationYExcluding(float translationY, Set<View> excludedViews) { for (int i = 0; i < mStatusViewContainer.getChildCount(); i++) { final View child = mStatusViewContainer.getChildAt(i); if (!excludedViews.contains(child)) { child.setTranslationY(translationY); } } } public float getChildrenAlphaExcludingSmartSpace() { return mChildrenAlphaExcludingSmartSpace; } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +7 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,13 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV return mKeyguardClockSwitchController.hasCustomClock(); } /** * Sets a translationY on the views on the keyguard, except on the media view. */ public void setTranslationYExcludingMedia(float translationY) { mView.setChildrenTranslationYExcludingMediaView(translationY); } /** * Set keyguard status view alpha. */ Loading
packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +12 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,18 @@ class MediaHierarchyManager @Inject constructor( fullShadeTransitionProgress = progress } /** * Returns the amount of translationY of the media container, during the current guided * transformation, if running. If there is no guided transformation running, it will return 0. */ fun getGuidedTransformationTranslationY(): Int { if (!isCurrentlyInGuidedTransformation()) { return -1 } val startHost = getHost(previousLocation) ?: return 0 return targetBounds.top - startHost.currentBounds.top } /** * Is the shade currently collapsing from the expanded qs? If we're on the lockscreen and in qs, * we wouldn't want to transition in that case. Loading
packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +17 −5 Original line number Diff line number Diff line Loading @@ -406,6 +406,7 @@ class LockscreenShadeTransitionController @Inject constructor( mediaHierarchyManager.setTransitionToFullShadeAmount(field) transitionToShadeAmountCommon(field) transitionToShadeAmountKeyguard(field) } } } Loading @@ -420,11 +421,6 @@ class LockscreenShadeTransitionController @Inject constructor( val scrimProgress = MathUtils.saturate(dragDownAmount / scrimTransitionDistance) scrimController.setTransitionToFullShadeProgress(scrimProgress) // Fade out all content only visible on the lockscreen val npvcProgress = MathUtils.saturate(dragDownAmount / npvcKeyguardContentAlphaTransitionDistance) notificationPanelController.setKeyguardOnlyContentAlpha(1.0f - npvcProgress) if (depthControllerTransitionDistance > 0) { val depthProgress = MathUtils.saturate(dragDownAmount / depthControllerTransitionDistance) Loading @@ -438,6 +434,22 @@ class LockscreenShadeTransitionController @Inject constructor( centralSurfaces.setTransitionToFullShadeProgress(statusBarProgress) } private fun transitionToShadeAmountKeyguard(dragDownAmount: Float) { // Fade out all content only visible on the lockscreen val keyguardAlphaProgress = MathUtils.saturate(dragDownAmount / npvcKeyguardContentAlphaTransitionDistance) val keyguardAlpha = 1f - keyguardAlphaProgress val keyguardTranslationY = if (useSplitShade) { // On split-shade, the translationY of the keyguard should stay in sync with the // translation of media. mediaHierarchyManager.getGuidedTransformationTranslationY() } else { 0 } notificationPanelController .setKeyguardTransitionProgress(keyguardAlpha, keyguardTranslationY) } private fun setDragDownAmountAnimated( target: Float, delay: Long = 0, Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +11 −3 Original line number Diff line number Diff line Loading @@ -616,6 +616,11 @@ public class NotificationPanelViewController extends PanelViewController { */ private float mKeyguardOnlyContentAlpha = 1.0f; /** * The translationY of the views which only show on the keyguard but in shade / shade locked. */ private int mKeyguardOnlyTransitionTranslationY = 0; private float mUdfpsMaxYBurnInOffset; /** Loading Loading @@ -1575,6 +1580,8 @@ public class NotificationPanelViewController extends PanelViewController { private void updateClock() { float alpha = mClockPositionResult.clockAlpha * mKeyguardOnlyContentAlpha; mKeyguardStatusViewController.setAlpha(alpha); mKeyguardStatusViewController .setTranslationYExcludingMedia(mKeyguardOnlyTransitionTranslationY); if (mKeyguardQsUserSwitchController != null) { mKeyguardQsUserSwitchController.setAlpha(alpha); } Loading Loading @@ -2732,11 +2739,12 @@ public class NotificationPanelViewController extends PanelViewController { } /** * Set the alpha of the keyguard elements which only show on the lockscreen, but not in * shade locked / shade. This is used when dragging down to the full shade. * Set the alpha and translationY of the keyguard elements which only show on the lockscreen, * but not in shade locked / shade. This is used when dragging down to the full shade. */ public void setKeyguardOnlyContentAlpha(float keyguardAlpha) { public void setKeyguardTransitionProgress(float keyguardAlpha, int keyguardTranslationY) { mKeyguardOnlyContentAlpha = Interpolators.ALPHA_IN.getInterpolation(keyguardAlpha); mKeyguardOnlyTransitionTranslationY = keyguardTranslationY; if (mBarState == KEYGUARD) { // If the animator is running, it's already fading out the content and this is a reset mBottomAreaShadeAlpha = mKeyguardOnlyContentAlpha; Loading