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

Commit 29d9d43e authored by Bryce Lee's avatar Bryce Lee
Browse files

Add RTL support for Communal scenes and transitions.

This changelist changes specifications for Communal scenes and
transitions to their RTL supported equivalents.

Test: manually verified user actions and transitions work properly with
Fixes: 320786721
Flag: com.android.systemui.communal_hub
Change-Id: Ic90f202df0696db42b8a93f5f304160ae4772aa0
parent 4f3b3951
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -88,12 +88,12 @@ val sceneTransitions = transitions {
    }
    to(CommunalScenes.Communal) {
        spec = tween(durationMillis = 1000)
        translate(Communal.Elements.Grid, Edge.Right)
        translate(Communal.Elements.Grid, Edge.End)
        timestampRange(startMillis = 167, endMillis = 334) { fade(AllElements) }
    }
    to(CommunalScenes.Blank) {
        spec = tween(durationMillis = 1000)
        translate(Communal.Elements.Grid, Edge.Right)
        translate(Communal.Elements.Grid, Edge.End)
        timestampRange(endMillis = 167) {
            fade(Communal.Elements.Grid)
            fade(Communal.Elements.IndicationArea)
@@ -186,9 +186,7 @@ fun CommunalContainer(
        scene(
            CommunalScenes.Blank,
            userActions =
                mapOf(
                    Swipe(SwipeDirection.Left, fromSource = Edge.Right) to CommunalScenes.Communal
                )
                mapOf(Swipe(SwipeDirection.Start, fromSource = Edge.End) to CommunalScenes.Communal)
        ) {
            // This scene shows nothing only allowing for transitions to the communal scene.
            Box(modifier = Modifier.fillMaxSize())
@@ -197,11 +195,11 @@ fun CommunalContainer(
        val userActions =
            if (glanceableHubBackGesture()) {
                mapOf(
                    Swipe(SwipeDirection.Right) to CommunalScenes.Blank,
                    Swipe(SwipeDirection.End) to CommunalScenes.Blank,
                    Back to CommunalScenes.Blank,
                )
            } else {
                mapOf(Swipe(SwipeDirection.Right) to CommunalScenes.Blank)
                mapOf(Swipe(SwipeDirection.End) to CommunalScenes.Blank)
            }

        scene(CommunalScenes.Communal, userActions = userActions) {
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ constructor(
    override val destinationScenes: Flow<Map<UserAction, UserActionResult>> =
        MutableStateFlow<Map<UserAction, UserActionResult>>(
                mapOf(
                    Swipe(SwipeDirection.Right) to UserActionResult(Scenes.Lockscreen),
                    Swipe(SwipeDirection.End) to UserActionResult(Scenes.Lockscreen),
                )
            )
            .asStateFlow()
+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ fun TransitionBuilder.lockscreenToCommunalTransition() {
    spec = tween(durationMillis = 500)

    // Translate lockscreen to the left.
    translate(Scenes.Lockscreen.rootElementKey, Edge.Left)
    translate(Scenes.Lockscreen.rootElementKey, Edge.Start)

    // Translate communal from the right.
    translate(Scenes.Communal.rootElementKey, Edge.Right)
    translate(Scenes.Communal.rootElementKey, Edge.End)
}