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

Commit 3ee571f7 authored by Will Leshner's avatar Will Leshner
Browse files

Replace slide transitions with fade for glanceable hub V2

This is for pre-flexiglass transitions. Flexiglass changes will be in
followup change.

Bug: 382743223
Test: manually
Flag: com.android.systemui.glanceable_hub_v2
Change-Id: I76a5c1f7f3f5c7f8ebfda9753f84dd90bc3ce5fe
parent 973dfac3
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -78,6 +78,18 @@ object TransitionDuration {
    const val EDIT_MODE_TO_HUB_GRID_END_MS =
        EDIT_MODE_TO_HUB_GRID_DELAY_MS + EDIT_MODE_TO_HUB_CONTENT_MS
    const val HUB_TO_EDIT_MODE_CONTENT_MS = 250
    const val TO_GLANCEABLE_HUB_DURATION_MS = 1000
}

val sceneTransitionsV2 = transitions {
    to(CommunalScenes.Communal) {
        spec = tween(durationMillis = TransitionDuration.TO_GLANCEABLE_HUB_DURATION_MS)
        fade(AllElements)
    }
    to(CommunalScenes.Blank) {
        spec = tween(durationMillis = TO_GONE_DURATION.toInt(DurationUnit.MILLISECONDS))
        fade(AllElements)
    }
}

val sceneTransitions = transitions {
@@ -157,7 +169,7 @@ fun CommunalContainer(
        MutableSceneTransitionLayoutState(
            initialScene = currentSceneKey,
            canChangeScene = { _ -> viewModel.canChangeScene() },
            transitions = sceneTransitions,
            transitions = if (viewModel.v2FlagEnabled()) sceneTransitionsV2 else sceneTransitions,
        )
    }
    val isUiBlurred by viewModel.isUiBlurred.collectAsStateWithLifecycle()
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import com.android.compose.animation.scene.TransitionKey
 */
object CommunalTransitionKeys {
    /** Fades the glanceable hub without any translation */
    @Deprecated("No longer supported as all hub transitions will be fades.")
    val SimpleFade = TransitionKey("SimpleFade")
    /** Transition from the glanceable hub before entering edit mode */
    val ToEditMode = TransitionKey("ToEditMode")