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

Commit a920b065 authored by William Leshner's avatar William Leshner Committed by Android (Google) Code Review
Browse files

Merge "Replace slide transitions with fade for glanceable hub V2" into main

parents af949563 3ee571f7
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")