Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +5 −1 Original line number Diff line number Diff line Loading @@ -830,7 +830,11 @@ private fun TransitionState.isOnLockscreen(): Boolean { } private fun shouldUseLockscreenStackBounds(state: TransitionState): Boolean { return state is TransitionState.Idle && state.isOnLockscreen() return when (state) { is TransitionState.Idle -> state.isOnLockscreen() is TransitionState.Transition -> state.isTransitioning(from = Scenes.Lockscreen, to = Scenes.Gone) } } private fun shouldUseLockscreenHunBounds( Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToGoneTransition.kt +14 −2 Original line number Diff line number Diff line package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.tween import androidx.compose.ui.unit.dp import com.android.compose.animation.Easings import com.android.compose.animation.scene.TransitionBuilder import com.android.systemui.plugins.keyguard.ui.composable.elements.LockscreenElementKeys import com.android.systemui.scene.shared.model.Scenes Loading @@ -8,6 +10,16 @@ import com.android.systemui.scene.shared.model.Scenes fun TransitionBuilder.lockscreenToGoneTransition() { spec = tween(durationMillis = 500) fade(Scenes.Lockscreen.rootElementKey) fractionRange(end = 0.3f, easing = Easings.PredictiveBack) { // Fade out all lock screen elements, except the status bar. fade(LockscreenElementKeys.Region.Upper) fade(LockscreenElementKeys.LockIcon) fade(LockscreenElementKeys.AmbientIndicationArea) fade(LockscreenElementKeys.Region.Lower) fade(LockscreenElementKeys.SettingsMenu) fade(LockscreenElementKeys.BehindScrim) translate(LockscreenElementKeys.Region.Upper, y = (-48).dp) translate(LockscreenElementKeys.Notifications.Stack, y = (-72).dp) } } packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToGoneTransitionViewModelTest.kt +18 −2 Original line number Diff line number Diff line Loading @@ -53,16 +53,32 @@ class LockscreenToGoneTransitionViewModelTest : SysuiTestCase() { @Test fun deviceEntryParentViewHides() = testScope.runTest { val deviceEntryParentViewAlpha by collectValues(underTest.deviceEntryParentViewAlpha) val deviceEntryParentViewAlpha by collectLastValue(underTest.deviceEntryParentViewAlpha) val tolerance = 0.05f repository.sendTransitionStep(step(0f, TransitionState.STARTED)) assertThat(deviceEntryParentViewAlpha).isEqualTo(1f) repository.sendTransitionStep(step(0.1f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.9f) repository.sendTransitionStep(step(0.3f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.7f) repository.sendTransitionStep(step(0.4f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.6f) repository.sendTransitionStep(step(0.5f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.5f) repository.sendTransitionStep(step(0.6f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.4f) repository.sendTransitionStep(step(0.8f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.2f) repository.sendTransitionStep(step(1f)) deviceEntryParentViewAlpha.forEach { assertThat(it).isEqualTo(0f) } assertThat(deviceEntryParentViewAlpha).isEqualTo(0f) } @Test Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToGoneTransitionViewModel.kt +5 −1 Original line number Diff line number Diff line Loading @@ -119,5 +119,9 @@ constructor( } override val deviceEntryParentViewAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(0f) transitionAnimation.sharedFlowWithShade( duration = 600.milliseconds, onStep = { step, isShadeExpanded -> if (isShadeExpanded) 0f else 1f - step }, onFinish = { 0f }, ) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +5 −1 Original line number Diff line number Diff line Loading @@ -830,7 +830,11 @@ private fun TransitionState.isOnLockscreen(): Boolean { } private fun shouldUseLockscreenStackBounds(state: TransitionState): Boolean { return state is TransitionState.Idle && state.isOnLockscreen() return when (state) { is TransitionState.Idle -> state.isOnLockscreen() is TransitionState.Transition -> state.isTransitioning(from = Scenes.Lockscreen, to = Scenes.Gone) } } private fun shouldUseLockscreenHunBounds( Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToGoneTransition.kt +14 −2 Original line number Diff line number Diff line package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.tween import androidx.compose.ui.unit.dp import com.android.compose.animation.Easings import com.android.compose.animation.scene.TransitionBuilder import com.android.systemui.plugins.keyguard.ui.composable.elements.LockscreenElementKeys import com.android.systemui.scene.shared.model.Scenes Loading @@ -8,6 +10,16 @@ import com.android.systemui.scene.shared.model.Scenes fun TransitionBuilder.lockscreenToGoneTransition() { spec = tween(durationMillis = 500) fade(Scenes.Lockscreen.rootElementKey) fractionRange(end = 0.3f, easing = Easings.PredictiveBack) { // Fade out all lock screen elements, except the status bar. fade(LockscreenElementKeys.Region.Upper) fade(LockscreenElementKeys.LockIcon) fade(LockscreenElementKeys.AmbientIndicationArea) fade(LockscreenElementKeys.Region.Lower) fade(LockscreenElementKeys.SettingsMenu) fade(LockscreenElementKeys.BehindScrim) translate(LockscreenElementKeys.Region.Upper, y = (-48).dp) translate(LockscreenElementKeys.Notifications.Stack, y = (-72).dp) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToGoneTransitionViewModelTest.kt +18 −2 Original line number Diff line number Diff line Loading @@ -53,16 +53,32 @@ class LockscreenToGoneTransitionViewModelTest : SysuiTestCase() { @Test fun deviceEntryParentViewHides() = testScope.runTest { val deviceEntryParentViewAlpha by collectValues(underTest.deviceEntryParentViewAlpha) val deviceEntryParentViewAlpha by collectLastValue(underTest.deviceEntryParentViewAlpha) val tolerance = 0.05f repository.sendTransitionStep(step(0f, TransitionState.STARTED)) assertThat(deviceEntryParentViewAlpha).isEqualTo(1f) repository.sendTransitionStep(step(0.1f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.9f) repository.sendTransitionStep(step(0.3f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.7f) repository.sendTransitionStep(step(0.4f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.6f) repository.sendTransitionStep(step(0.5f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.5f) repository.sendTransitionStep(step(0.6f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.4f) repository.sendTransitionStep(step(0.8f)) assertThat(deviceEntryParentViewAlpha).isWithin(tolerance).of(0.2f) repository.sendTransitionStep(step(1f)) deviceEntryParentViewAlpha.forEach { assertThat(it).isEqualTo(0f) } assertThat(deviceEntryParentViewAlpha).isEqualTo(0f) } @Test Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToGoneTransitionViewModel.kt +5 −1 Original line number Diff line number Diff line Loading @@ -119,5 +119,9 @@ constructor( } override val deviceEntryParentViewAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(0f) transitionAnimation.sharedFlowWithShade( duration = 600.milliseconds, onStep = { step, isShadeExpanded -> if (isShadeExpanded) 0f else 1f - step }, onFinish = { 0f }, ) }