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

Commit 4dd3f905 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge "Fix STLImpl scene update" into main

parents 787f5eee e7fddfad
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -280,6 +280,10 @@ internal fun SceneTransitionLayoutForTesting(
            .also { onLayoutImpl?.invoke(it) }
    }

    // TODO(b/317014852): Move this into the SideEffect {} again once STLImpl.scenes is not a
    // SnapshotStateMap anymore.
    layoutImpl.updateScenes(scenes)

    val targetSceneChannel = remember { Channel<SceneKey>(Channel.CONFLATED) }
    SideEffect {
        if (state != layoutImpl.state) {
@@ -293,7 +297,6 @@ internal fun SceneTransitionLayoutForTesting(
        (state as SceneTransitionLayoutStateImpl).transitions = transitions
        layoutImpl.density = density
        layoutImpl.edgeDetector = edgeDetector
        layoutImpl.updateScenes(scenes)

        state.transitions = transitions

+6 −1
Original line number Diff line number Diff line
@@ -46,7 +46,12 @@ internal class SceneTransitionLayoutImpl(
    builder: SceneTransitionLayoutScope.() -> Unit,
    coroutineScope: CoroutineScope,
) {
    internal val scenes = mutableMapOf<SceneKey, Scene>()
    /**
     * The map of [Scene]s.
     *
     * TODO(b/317014852): Make this a normal MutableMap instead.
     */
    internal val scenes = SnapshotStateMap<SceneKey, Scene>()

    /**
     * The map of [Element]s.