allan.conda
05/13/2021, 6:24 PMallan.conda
05/13/2021, 6:25 PMnavController.navigate("screen_in_A")
navController.navigate("screen_in_B")
Will this work?
Edit: 🤦 forgot we’re talking deeplinks here, so this idea is stupidIan Lake
05/13/2021, 6:41 PMIan Lake
05/13/2021, 6:42 PMallan.conda
05/13/2021, 6:59 PMnavigation("main") {
composable("top") { TopScreen() }
navigation("A") {
composable("screen_in_a") { ScreenInA() }
navigation("B") {
composable("screen_in_b) {
ScreenInB()
}
}
}
}
If I understand this correctly.allan.conda
05/13/2021, 7:03 PMnavigation("main") {
composable("top") { TopScreen() }
navigationA() // defined in feature_a module
navigationB() // defined in feature_b module
}
so from within A we can still call navController.navigate("screen_in_b")
without coupling module A with Ballan.conda
05/13/2021, 7:07 PMnavigation("main") {
navigationA(
screenInB = {
ActualScreenInB()
}
)
}
// feature a
fun NavGraphBuilder.navigationA(
screenInB: () -> Unit,
) {
navigation("A") {
composable("screen_in_a") { ScreenInA()
navigation("B") {
screenInB()
}
}
}
Ian Lake
05/13/2021, 7:15 PMnavigationA()
just take a embeddedGraph: NavGraphBuilder.() -> Unit
? Then you could do navigationA(navigationB())
Ian Lake
05/13/2021, 7:16 PMnavigation("B")
really is a subgraph of navigation("A")
, then your graph structure should represent thatallan.conda
05/13/2021, 7:23 PMallan.conda
05/13/2021, 7:24 PMthen your graph structure should represent thatYeah! I was thinking of this too, having two nav graphs at the same level doesn’t seem right, I use that kind of pattern more for global/shared navigations. I just never thought I could just pass the graph directly… Thanks Ian!