Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78360d34 authored by Shawn Lee's avatar Shawn Lee
Browse files

[flexiglass] Fix bouncer to lockscreen transition

Utilizes the scrim fade behavior that was already added for the shade -> lockscreen transition

Bug: 347773206
Test: manually verified transition follows spec (legacy)
Flag: com.android.systemui.scene_container
Change-Id: I14b38827cc6c1fe03e17aab9be53a24135b2d0ed
parent 0271c48d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -114,5 +114,6 @@ private fun shouldShowScrimFadeOut(
): Boolean {
    return shadeMode == ShadeMode.Single &&
        currentTransition.isInitiatedByUserInput &&
        currentTransition.isTransitioning(from = Scenes.Shade, to = Scenes.Lockscreen)
        (currentTransition.isTransitioning(from = Scenes.Shade, to = Scenes.Lockscreen) ||
            currentTransition.isTransitioning(from = Scenes.Bouncer, to = Scenes.Lockscreen))
}
+6 −0
Original line number Diff line number Diff line
@@ -4,13 +4,19 @@ import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.tween
import androidx.compose.ui.unit.dp
import com.android.compose.animation.scene.TransitionBuilder
import com.android.compose.animation.scene.UserActionDistance
import com.android.systemui.bouncer.ui.composable.Bouncer

const val FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION = 0.5f
const val FROM_LOCK_SCREEN_TO_BOUNCER_SWIPE_DISTANCE_FRACTION = 0.5f

fun TransitionBuilder.lockscreenToBouncerTransition() {
    spec = tween(durationMillis = 500)

    distance = UserActionDistance { fromSceneSize, _ ->
        fromSceneSize.height * FROM_LOCK_SCREEN_TO_BOUNCER_SWIPE_DISTANCE_FRACTION
    }

    translate(Bouncer.Elements.Content, y = 300.dp)
    fractionRange(end = FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION) {
        fade(Bouncer.Elements.Background)