You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use jetpack compose with ComposeRibView like this
class HomeViewImpl private constructor(context: Context) : ComposeRibView(context), HomeView {
private var bottomBar = mutableStateOf<ComposeView?>(null)
private var content = mutableStateOf<ComposeView?>(null)
override val composable: @Composable () -> Unit = {
Column(
modifier =
Modifier.fillMaxSize().background(MaterialTheme.colors.surface)
) {
Box(modifier = Modifier.fillMaxWidth().weight(1f)) {
content.value?.invoke()
}
bottomBar.value?.invoke()
}
}
override fun getParentViewForSubtree(subtreeOf: Node<*>): MutableState<ComposeView?> {
return when (subtreeOf) {
is BottomBar -> bottomBar
else -> content
}
}
class Factory : HomeView.Factory {
override fun invoke(p1: Nothing?): (RibView) -> HomeView = { HomeViewImpl(it.context) }
}
}
Backstack uses content to show backstack content.
The problem is that when I'm pushing something in the backstack attachChild is called before detachChild, so my content value becomes null after attaching the child. Are there any other ways to use compose with backstack ?
The text was updated successfully, but these errors were encountered:
Hello there! 👋
I'm trying to use jetpack compose with
ComposeRibView
like thisBackstack uses
content
to show backstack content.The problem is that when I'm pushing something in the backstack
attachChild
is called beforedetachChild
, so mycontent
value becomesnull
after attaching the child. Are there any other ways to use compose with backstack ?The text was updated successfully, but these errors were encountered: