diff --git a/library/compose-threepane/src/commonMain/kotlin/com/tunjid/treenav/compose/threepane/panedecorators/ThreePaneMovableSharedElementDecorator.kt b/library/compose-threepane/src/commonMain/kotlin/com/tunjid/treenav/compose/threepane/panedecorators/ThreePaneMovableSharedElementDecorator.kt index 62d6d31..a9542da 100644 --- a/library/compose-threepane/src/commonMain/kotlin/com/tunjid/treenav/compose/threepane/panedecorators/ThreePaneMovableSharedElementDecorator.kt +++ b/library/compose-threepane/src/commonMain/kotlin/com/tunjid/treenav/compose/threepane/panedecorators/ThreePaneMovableSharedElementDecorator.kt @@ -36,6 +36,7 @@ import com.tunjid.treenav.compose.MultiPaneDisplay import com.tunjid.treenav.compose.MultiPaneDisplayState import com.tunjid.treenav.compose.PaneScope import com.tunjid.treenav.compose.PaneState +import com.tunjid.treenav.compose.PaneNavigationState import com.tunjid.treenav.compose.moveablesharedelement.MovableSharedElementHostState import com.tunjid.treenav.compose.moveablesharedelement.MovableSharedElementScope import com.tunjid.treenav.compose.moveablesharedelement.PaneMovableSharedElementScope @@ -113,6 +114,9 @@ private class ThreePaneMovableSharedElementScope( override val sharedTransitionScope: SharedTransitionScope get() = delegate.sharedTransitionScope + override val paneNavigationState: PaneNavigationState + get() = delegate.paneScope.paneNavigationState + override val transition: Transition get() = delegate.paneScope.transition diff --git a/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/MultiPaneDisplay.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/MultiPaneDisplay.kt index 6028fb0..a41ab49 100644 --- a/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/MultiPaneDisplay.kt +++ b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/MultiPaneDisplay.kt @@ -53,9 +53,9 @@ import kotlinx.coroutines.CancellationException interface MultiPaneDisplayScope { /** - * All possible panes in the [MultiPaneDisplayScope]. + * Provides the pane navigation state for the [MultiPaneDisplay]. */ - val panes: Collection + val paneNavigationState: PaneNavigationState /** * Renders the given [Destination] in the provided [Pane]. @@ -64,20 +64,6 @@ interface MultiPaneDisplayScope { fun Destination( pane: Pane, ) - - /** - * Provides the set of adaptations in the provided [Pane]. - */ - fun adaptationsIn( - pane: Pane, - ): Set - - /** - * Returns the [Destination] in the provided [Pane]. - */ - fun destinationIn( - pane: Pane, - ): Destination? } /** @@ -130,7 +116,7 @@ fun MultiPaneDisplay( } val initialPanedNavigationState = remember { - SlotBasedPanedNavigationState.initial(slots = slots) + SlotBasedPaneNavigationState.initial(slots = slots) .adaptTo( slots = slots, panesToDestinations = panesToDestinations.value, @@ -209,7 +195,7 @@ private class MultiPanePaneSceneStrategy, private val slots: Set, private val backStatus: () -> BackStatus, - private val currentPanedNavigationState: () -> SlotBasedPanedNavigationState, + private val currentPanedNavigationState: () -> SlotBasedPaneNavigationState, private val content: @Composable (MultiPaneDisplayScope.() -> Unit), ) : SceneStrategy { @@ -280,7 +266,7 @@ private class MultiPaneDisplayScene( private val sceneKey: MultiPaneSceneKey, private val destination: Destination, private val slots: Set, - private val currentPanedNavigationState: SlotBasedPanedNavigationState, + private val currentPanedNavigationState: SlotBasedPaneNavigationState, backStatus: () -> BackStatus, private val panesToDestinations: @Composable (Destination) -> Map, private val scopeContent: @Composable (MultiPaneDisplayScope.() -> Unit), @@ -324,23 +310,20 @@ private class MultiPaneDisplayScene( @Stable class PaneDestinationMultiPaneDisplayScope( - panedNavigationState: State>, + panedNavigationState: State>, private val currentEntries: () -> List>, private val backStatus: () -> BackStatus, ) : MultiPaneDisplayScope { - private val panedNavigationState by panedNavigationState - - override val panes: Collection - get() = panedNavigationState.panesToDestinations.keys + override val paneNavigationState by panedNavigationState @Composable override fun Destination(pane: Pane) { - val id = panedNavigationState.destinationFor(pane)?.id + val id = paneNavigationState.destinationIn(pane)?.id val entry = currentEntries().firstOrNull { it.id == id } ?: return - val paneState = remember(panedNavigationState.identityHash()) { - panedNavigationState.slotFor(pane)?.let(panedNavigationState::paneStateFor) + val paneState = remember(paneNavigationState.identityHash()) { + paneNavigationState.slotFor(pane)?.let(paneNavigationState::paneStateFor) } ?: return val animatedContentScope = LocalNavAnimatedContentScope.current @@ -350,6 +333,7 @@ private class MultiPaneDisplayScene( backStatus = backStatus, paneState = paneState, animatedContentScope = animatedContentScope, + navigationState = { paneNavigationState }, ) }.also { it.paneState = paneState @@ -361,35 +345,21 @@ private class MultiPaneDisplayScene( entry.Content() } } - - override fun adaptationsIn(pane: Pane): Set = - panedNavigationState.adaptationsIn(pane) - - override fun destinationIn(pane: Pane): Destination? = - panedNavigationState.destinationFor(pane) } } @Stable private class NonRenderingMultiPaneDisplayScope( - panedNavigationState: State>, + panedNavigationState: State>, ) : MultiPaneDisplayScope { - private val panedNavigationState by panedNavigationState - - override val panes: Collection - get() = panedNavigationState.panesToDestinations.keys + override val paneNavigationState by panedNavigationState @Composable override fun Destination(pane: Pane) = throw IllegalStateException( "This MultiPaneDisplayScope cannot render panes" ) - override fun adaptationsIn(pane: Pane): Set = - panedNavigationState.adaptationsIn(pane) - - override fun destinationIn(pane: Pane): Destination? = - panedNavigationState.destinationFor(pane) } private fun MultiPaneDisplayState.findNavigationStateMatching( @@ -406,11 +376,11 @@ private fun MultiPaneDisplayState SlotBasedPanedNavigationState.rememberUpdatedPanedNavigationState( +private fun SlotBasedPaneNavigationState.rememberUpdatedPanedNavigationState( backStackIds: List, panesToDestinations: Map, slots: Set -): State> = +): State> = remember { mutableStateOf(this) }.also { diff --git a/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/PaneScope.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/PaneScope.kt index a9f695e..e6421cf 100644 --- a/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/PaneScope.kt +++ b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/PaneScope.kt @@ -33,6 +33,11 @@ import kotlin.jvm.JvmInline @Stable interface PaneScope : AnimatedVisibilityScope { + /** + * Provides the pane navigation state that created this [PaneScope]. + */ + val paneNavigationState: PaneNavigationState + /** * Provides information about the adaptive context that created this [PaneScope]. */ @@ -60,6 +65,7 @@ interface PaneScope : AnimatedVisibilityScope { @Stable internal class AnimatedPaneScope( val backStatus: () -> BackStatus, + val navigationState: () -> PaneNavigationState, paneState: PaneState, animatedContentScope: AnimatedContentScope, ) : PaneScope, AnimatedVisibilityScope by animatedContentScope { @@ -67,6 +73,9 @@ internal class AnimatedPaneScope( private val isEntering get() = transition.targetState == EnterExitState.Visible + override val paneNavigationState: PaneNavigationState + get() = navigationState() + override var paneState by mutableStateOf(paneState) override val isActive: Boolean diff --git a/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/SlotBasedPanedNavigationState.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/SlotBasedPaneNavigationState.kt similarity index 85% rename from library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/SlotBasedPanedNavigationState.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/SlotBasedPaneNavigationState.kt index 7503e44..2c5cd92 100644 --- a/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/SlotBasedPanedNavigationState.kt +++ b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/compose/SlotBasedPaneNavigationState.kt @@ -20,11 +20,33 @@ import androidx.compose.runtime.Immutable import com.tunjid.treenav.Node import com.tunjid.treenav.compose.Adaptation.Change.contains +interface PaneNavigationState { + + /** + * The id of the [Destination] that produced this [PaneNavigationState]. + */ + val destinationId: String + + /** + * Provides the set of adaptations in the provided [Pane]. + */ + fun adaptationsIn( + pane: Pane, + ): Set + + /** + * Returns the [Destination] in the provided [Pane]. + */ + fun destinationIn( + pane: Pane, + ): Destination? +} + /** * Data structure for managing navigation as it adapts to various layout configurations */ @Immutable -internal data class SlotBasedPanedNavigationState( +internal data class SlotBasedPaneNavigationState( /** * True if this navigation change is as a result of popping the backStack. */ @@ -49,11 +71,11 @@ internal data class SlotBasedPanedNavigationState( * A set of node ids that may be returned to. */ val backStackIds: List, -) { +) : PaneNavigationState { companion object { internal fun initial( slots: Collection, - ): SlotBasedPanedNavigationState = SlotBasedPanedNavigationState( + ): SlotBasedPaneNavigationState = SlotBasedPaneNavigationState( isPop = false, swapAdaptations = emptySet(), panesToDestinations = emptyMap(), @@ -65,10 +87,13 @@ internal data class SlotBasedPanedNavigationState( ) } + override val destinationId: String + get() = backStackIds.last() + internal fun paneStateFor( slot: Slot, ): PaneState { - val node = destinationFor(slot) + val node = destinationIn(slot) val pane = node?.let(::paneFor) return SlotPaneState( slot = slot, @@ -91,7 +116,7 @@ internal data class SlotBasedPanedNavigationState( if (paneDestination?.id == destination.id) pane else null } - private fun destinationFor( + private fun destinationIn( slot: Slot, ): Destination? = destinationIdsToAdaptiveSlots.firstNotNullOfOrNull { (nodeId, nodeSlot) -> if (nodeSlot == slot) panesToDestinations.firstNotNullOfOrNull { (_, node) -> @@ -101,17 +126,18 @@ internal data class SlotBasedPanedNavigationState( else null } - fun destinationFor( + override fun destinationIn( pane: Pane, ): Destination? = panesToDestinations[pane] - fun adaptationsIn( + override fun adaptationsIn( pane: Pane, ): Set { val adaptations = when { swapAdaptations.any { pane in it } -> swapAdaptations.filterTo(mutableSetOf()) { pane in it } + else -> when (panesToDestinations[pane]?.id) { previousPanesToDestinations[pane]?.id -> SameAdaptations else -> ChangeAdaptations @@ -128,11 +154,11 @@ private val ChangeAdaptations = setOf(Adaptation.Change) * A method that adapts changes in navigation to different panes while allowing for them * to be animated easily. */ -internal fun SlotBasedPanedNavigationState.adaptTo( +internal fun SlotBasedPaneNavigationState.adaptTo( slots: Set, panesToDestinations: Map, backStackIds: List, -): SlotBasedPanedNavigationState { +): SlotBasedPaneNavigationState { val previous = this val previouslyUsedSlots = previous.destinationIdsToAdaptiveSlots @@ -185,8 +211,8 @@ internal fun SlotBasedPanedNavigationState + return SlotBasedPaneNavigationState( + isPop = backStackIds.let popCheck@{ ids -> if (ids.size >= previous.backStackIds.size) return@popCheck false if (ids.isEmpty()) return@popCheck true @@ -201,7 +227,7 @@ internal fun SlotBasedPanedNavigationState swapAdaptations }, previousPanesToDestinations = previous.panesToDestinations.keys.associateWith( - valueSelector = previous::destinationFor + valueSelector = previous::destinationIn ), destinationIdsToAdaptiveSlots = nodeIdsToAdaptiveSlots, backStackIds = backStackIds, diff --git a/library/compose/src/commonTest/kotlin/com/tunjid/treenav/compose/SlotBasedAdaptiveNavigationStateTest.kt b/library/compose/src/commonTest/kotlin/com/tunjid/treenav/compose/SlotBasedAdaptiveNavigationStateTest.kt index 19cff24..12c3da8 100644 --- a/library/compose/src/commonTest/kotlin/com/tunjid/treenav/compose/SlotBasedAdaptiveNavigationStateTest.kt +++ b/library/compose/src/commonTest/kotlin/com/tunjid/treenav/compose/SlotBasedAdaptiveNavigationStateTest.kt @@ -43,7 +43,7 @@ enum class TestPane { class SlotBasedAdaptiveNavigationStateTest { - private lateinit var subject: SlotBasedPanedNavigationState + private lateinit var subject: SlotBasedPaneNavigationState private lateinit var panes: List private lateinit var slots: Set @@ -52,7 +52,7 @@ class SlotBasedAdaptiveNavigationStateTest { fun setup() { panes = TestPane.entries.toList() slots = List(size = panes.size, init = ::Slot).toSet() - subject = SlotBasedPanedNavigationState.initial( + subject = SlotBasedPaneNavigationState.initial( slots = slots ) } @@ -67,7 +67,7 @@ class SlotBasedAdaptiveNavigationStateTest { ) .apply { assertEquals( - expected = destinationFor(TestPane.One), + expected = destinationIn(TestPane.One), actual = TestNode(name = "A"), ) assertEquals( @@ -95,7 +95,7 @@ class SlotBasedAdaptiveNavigationStateTest { .apply { // Primary assertEquals( - expected = destinationFor(TestPane.One), + expected = destinationIn(TestPane.One), actual = TestNode(name = "A") ) assertEquals( @@ -109,7 +109,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Secondary assertEquals( - expected = destinationFor(TestPane.Two), + expected = destinationIn(TestPane.Two), actual = TestNode(name = "B") ) assertEquals( @@ -123,7 +123,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Tertiary assertEquals( - expected = destinationFor(TestPane.Three), + expected = destinationIn(TestPane.Three), actual = TestNode(name = "C") ) assertEquals( @@ -155,7 +155,7 @@ class SlotBasedAdaptiveNavigationStateTest { .apply { assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = setOf(Adaptation.Same), @@ -191,7 +191,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Primary assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = setOf(Adaptation.Same), @@ -205,7 +205,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Secondary assertEquals( expected = TestNode(name = "B"), - actual = destinationFor(TestPane.Two), + actual = destinationIn(TestPane.Two), ) assertEquals( expected = setOf(Adaptation.Same), @@ -219,7 +219,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Tertiary assertEquals( expected = TestNode(name = "C"), - actual = destinationFor(TestPane.Three), + actual = destinationIn(TestPane.Three), ) assertEquals( expected = setOf(Adaptation.Same), @@ -255,7 +255,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Primary assertEquals( expected = TestNode(name = "B"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = setOf( @@ -272,7 +272,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Secondary assertEquals( expected = TestNode(name = "C"), - actual = destinationFor(TestPane.Two), + actual = destinationIn(TestPane.Two), ) assertEquals( expected = setOf( @@ -289,7 +289,7 @@ class SlotBasedAdaptiveNavigationStateTest { // Tertiary assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.Three), + actual = destinationIn(TestPane.Three), ) assertEquals( expected = setOf( @@ -325,11 +325,11 @@ class SlotBasedAdaptiveNavigationStateTest { // Destination assertions assertEquals( expected = TestNode(name = "B"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.Two), + actual = destinationIn(TestPane.Two), ) // Adaptation assertions @@ -395,11 +395,11 @@ class SlotBasedAdaptiveNavigationStateTest { // Destination assertions assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = TestNode(name = "B"), - actual = destinationFor(TestPane.Three), + actual = destinationIn(TestPane.Three), ) // Adaptation assertions @@ -445,11 +445,11 @@ class SlotBasedAdaptiveNavigationStateTest { // Destination assertions assertEquals( expected = TestNode(name = "C"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.Three), + actual = destinationIn(TestPane.Three), ) // Adaptation assertions @@ -502,15 +502,15 @@ class SlotBasedAdaptiveNavigationStateTest { // Destination assertions assertEquals( expected = TestNode(name = "C"), - actual = destinationFor(TestPane.One), + actual = destinationIn(TestPane.One), ) assertEquals( expected = TestNode(name = "D"), - actual = destinationFor(TestPane.Two), + actual = destinationIn(TestPane.Two), ) assertEquals( expected = TestNode(name = "A"), - actual = destinationFor(TestPane.Three), + actual = destinationIn(TestPane.Three), ) // Adaptation assertions @@ -585,7 +585,7 @@ class SlotBasedAdaptiveNavigationStateTest { } } - private fun SlotBasedPanedNavigationState.testAdaptTo( + private fun SlotBasedPaneNavigationState.testAdaptTo( navState: StackNav, panesToDestinations: Map, ) = adaptTo( diff --git a/libraryVersion.properties b/libraryVersion.properties index 0a3a001..abdb40a 100644 --- a/libraryVersion.properties +++ b/libraryVersion.properties @@ -14,7 +14,7 @@ # limitations under the License. # groupId=com.tunjid.treenav -treenav_version=0.0.42 -strings_version=0.0.42 -compose_version=0.0.42 -compose-threepane_version=0.0.42 \ No newline at end of file +treenav_version=0.0.43 +strings_version=0.0.43 +compose_version=0.0.43 +compose-threepane_version=0.0.43 \ No newline at end of file diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt index ff4d3bf..32c2ca7 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt @@ -81,8 +81,8 @@ import com.tunjid.demo.common.ui.me.mePaneEntry import com.tunjid.demo.common.ui.profile.profilePaneEntry import com.tunjid.treenav.MultiStackNav import com.tunjid.treenav.compose.MultiPaneDisplay -import com.tunjid.treenav.compose.MultiPaneDisplayScope import com.tunjid.treenav.compose.MultiPaneDisplayState +import com.tunjid.treenav.compose.PaneNavigationState import com.tunjid.treenav.compose.moveablesharedelement.MovableSharedElementHostState import com.tunjid.treenav.compose.multiPaneDisplayBackstack import com.tunjid.treenav.compose.navigation3.ui.NavigationEventHandler @@ -142,27 +142,27 @@ fun App( modifier = Modifier .fillMaxSize(), ) { - val splitPaneDisplayScope = remember { - SplitPaneDisplayScope( - displayScope = this, + val splitPaneState = remember { + SplitPaneState( + paneNavigationState = paneNavigationState, windowWidth = windowWidth, ) }.also { it.update( - displayScope = this, + paneNavigationState = paneNavigationState, ) } CompositionLocalProvider( - LocalSplitPaneDisplayScope provides splitPaneDisplayScope + LocalSplitPaneState provides splitPaneState ) { SplitLayout( - state = splitPaneDisplayScope.splitLayoutState, + state = splitPaneState.splitLayoutState, modifier = Modifier .fillMaxSize(), itemSeparators = { paneIndex, offset -> PaneSeparator( - splitLayoutState = splitPaneDisplayScope.splitLayoutState, + splitLayoutState = splitPaneState.splitLayoutState, interactionSource = appState.paneInteractionSourceAt(paneIndex), index = paneIndex, density = density, @@ -170,7 +170,7 @@ fun App( ) }, itemContent = { index -> - Destination(splitPaneDisplayScope.filteredPaneOrder[index]) + Destination(splitPaneState.filteredPaneOrder[index]) } ) } @@ -347,15 +347,15 @@ class AppState( } @Stable -internal class SplitPaneDisplayScope( - displayScope: MultiPaneDisplayScope, +internal class SplitPaneState( + paneNavigationState: PaneNavigationState, private val windowWidth: State, ) { - private var displayScope by mutableStateOf(displayScope) + private var paneNavigationState by mutableStateOf(paneNavigationState) internal val filteredPaneOrder by derivedStateOf { - PaneRenderOrder.filter { displayScope.destinationIn(it) != null } + PaneRenderOrder.filter { paneNavigationState.destinationIn(it) != null } } internal val splitLayoutState = SplitLayoutState( @@ -372,19 +372,19 @@ internal class SplitPaneDisplayScope( get() = windowWidth.value >= SecondaryPaneMinWidthBreakpointDp fun update( - displayScope: MultiPaneDisplayScope + paneNavigationState: PaneNavigationState ) { - this.displayScope = displayScope + this.paneNavigationState = paneNavigationState splitLayoutState.visibleCount = filteredPaneOrder.size } } -internal val LocalSplitPaneDisplayScope = staticCompositionLocalOf { - TODO() +internal val LocalSplitPaneState = staticCompositionLocalOf { + throw IllegalStateException("LocalSplitPaneState not set") } internal val LocalAppState = staticCompositionLocalOf { - TODO() + throw IllegalStateException("LocalAppState not set") } private val PaneRenderOrder = listOf( diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/PaneScaffold.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/PaneScaffold.kt index 8b274c3..cd6114f 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/PaneScaffold.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/PaneScaffold.kt @@ -55,15 +55,15 @@ import kotlinx.coroutines.flow.filterNotNull @Stable class PaneScaffoldState internal constructor( - private val splitPaneDisplayScope: SplitPaneDisplayScope, + private val splitPaneState: SplitPaneState, threePaneMovableElementSharedTransitionScope: ThreePaneMovableElementSharedTransitionScope, ) : ThreePaneMovableElementSharedTransitionScope by threePaneMovableElementSharedTransitionScope { - internal val canShowNavigationBar get() = !splitPaneDisplayScope.isMediumScreenWidthOrWider + internal val canShowNavigationBar get() = !splitPaneState.isMediumScreenWidthOrWider internal val canShowNavigationRail - get() = splitPaneDisplayScope.filteredPaneOrder.firstOrNull() == paneState.pane - && splitPaneDisplayScope.isMediumScreenWidthOrWider + get() = splitPaneState.filteredPaneOrder.firstOrNull() == paneState.pane + && splitPaneState.isMediumScreenWidthOrWider internal val canUseMovableNavigationBar get() = canShowNavigationBar && isActive && paneState.pane == ThreePane.Primary @@ -71,7 +71,7 @@ class PaneScaffoldState internal constructor( internal val canUseMovableNavigationRail get() = canShowNavigationRail && isActive - internal val hasSiblings get() = splitPaneDisplayScope.filteredPaneOrder.size > 1 + internal val hasSiblings get() = splitPaneState.filteredPaneOrder.size > 1 internal val defaultContainerColor: Color @Composable get() { @@ -89,12 +89,12 @@ class PaneScaffoldState internal constructor( @Composable fun PaneScope.rememberPaneScaffoldState(): PaneScaffoldState { - val splitPaneDisplayScope = LocalSplitPaneDisplayScope.current + val splitPaneDisplayScope = LocalSplitPaneState.current val paneMovableElementSharedTransitionScope = rememberThreePaneMovableElementSharedTransitionScope() return remember(splitPaneDisplayScope, paneMovableElementSharedTransitionScope) { PaneScaffoldState( - splitPaneDisplayScope = splitPaneDisplayScope, + splitPaneState = splitPaneDisplayScope, threePaneMovableElementSharedTransitionScope = paneMovableElementSharedTransitionScope, ) }