I'm using the TwoPaneSceneStrategy as available on Google's Nav3 Recipes repo to display the content in a NavDisplay. This is the Scene that actually displays the content:
class TwoPaneScene<T : Any>(
override val key: Any,
override val previousEntries: List<NavEntry<T>>,
val firstEntry: NavEntry<T>,
val secondEntry: NavEntry<T>
) : Scene<T> {
override val entries: List<NavEntry<T>> = listOf(firstEntry, secondEntry)
override val content: @Composable (() -> Unit) = {
Row(modifier = Modifier.fillMaxSize()) {
Column(modifier = Modifier.weight(1f)) {
firstEntry.Content()
}
Column(modifier = Modifier.weight(1f)) {
secondEntry.Content()
}
}
}
...
I'm trying to make a UI that consists of a main left pane that should always be in view, and a right pane that should slide in when it is on the backstack, and should use a fade transition to change the content on the right pane (the left pane remains unaffected), and slides out (with a predictive back transition) when it is popped out of the backstack, making the left pane expand to the full width. The two panes should be of equal width.
I've tried modifying the transition specs in NavDisplay, tweaked with TwoPaneScene but I just can't seem to implement this.
I appreciate any help. Thanks in advance!