Kshitij Patil
10/28/2020, 2:03 PMstringResource(resId)
in its get()
methodJavier
10/28/2020, 2:09 PMnavigate
extension and use my own Route enum class
as route argumentZach Klippenstein (he/him) [MOD]
10/28/2020, 2:27 PMJavier
10/28/2020, 2:29 PMenum
to sealed
🤔 but if a destination is shared two screens...?, I have to think about this when I "crash" with those use casessealed class
maybe I had to add a required Id
and I have to set manually which add more boilerplateAfzal Najam
10/28/2020, 2:48 PMJavier
10/28/2020, 2:54 PMAfzal Najam
10/28/2020, 2:56 PMsealed class Screen(val route: String) {
object Dashboard : Screen("Dashboard") {
val routeWithArg: String = "$route?arg={arg}"
fun withArg(arg: String): String = routeWithArg.replace("{arg}", arg)
}
}
Javier
10/28/2020, 2:57 PMsimpleName
(impossible because you can get duplicated routes) and qualified
of jvmName
have the entire file, and I think there is an open issue about sealed classes
where you can extend a sealed class from a different file and this, maybe, can have problemsZach Klippenstein (he/him) [MOD]
10/28/2020, 3:11 PMdid you have modeled something like this when you developed your own navigation library?Not sure exactly what you’re referring to.
compose-backstack
tries to do as little as possible, the only reason it even has a backstack at all (in contrast to something like Crossfade
, which only takes the “current” screen key) is to figure out whether a forward or backward transition animation should be shown.Ian Lake
10/28/2020, 5:07 PMKshitij Patil
10/28/2020, 5:57 PMif you're not using it for backstack management
navigation-compose
does support the backstack management right?javaclass.simpleName
won't work?Zach Klippenstein (he/him) [MOD]
10/28/2020, 5:58 PMmyBackstack += newScreen
, myBackstack.dropLast()
Javier
10/28/2020, 6:00 PMKshitij Patil
10/28/2020, 6:05 PMnavigation-compose
for nested graphs? was just curious how we need to deal with those scenarios. I'm aware of the one by @ Afzal NajamJavier
10/28/2020, 6:05 PMKshitij Patil
10/28/2020, 6:07 PMJavier
10/28/2020, 6:09 PMIan Lake
10/28/2020, 6:09 PMnavigation
element for nested graphs. We could certainly add an overload of that which lets you define it with a route (rather than an int ID as is required in the base Navigation DSL)Zach Klippenstein (he/him) [MOD]
10/28/2020, 8:47 PM