Rafael Costa
04/26/2024, 4:39 PMRafael Costa
04/26/2024, 4:39 PMRafael Costa
04/26/2024, 4:40 PMRafael Costa
04/26/2024, 4:40 PMExtension is shadowed by a member: public final fun <T : Any> navigate(route: T, builder: NavOptionsBuilder.() -> Unit): Unit
Rafael Costa
04/26/2024, 4:42 PMRafael Costa
04/26/2024, 4:46 PMIan Lake
04/26/2024, 4:48 PMRafael Costa
04/26/2024, 4:51 PMGuilherme Delgado
04/26/2024, 4:53 PMnavigate
could be changed to navigateTo
but yeahโฆ itโs a bit bittersweet. And I bet you have a lot more with no good prefix/suffix candidate. Well, one thing is for sure, itโs going to be a โbreaking changes releaseโ.Ian Lake
04/26/2024, 4:55 PMRafael Costa
04/26/2024, 4:55 PMpopUpTo
(and others).Ian Lake
04/26/2024, 4:55 PMRafael Costa
04/26/2024, 4:58 PMIan Lake
04/26/2024, 4:59 PMnavigateVia
since 'navigating via directions' reads well, but YMMVRafael Costa
04/26/2024, 5:04 PMpopUpTo
.
There's also the question of the future of the library with these type safe APIs coming out.
I see there's some value I can provide to users of my library because I know about the graph structure at compile time.
But I suspect most people use Compose Destinations mostly for type safe args.
(To be clear to anyone reading this, I plan to support the library even if I have a single user. So no one panic please ๐. I'm just writing my thoughts to also see what these smart individuals think about it ๐)Guilherme Delgado
04/26/2024, 5:13 PMGuilherme Delgado
04/26/2024, 5:14 PMRafael Costa
04/26/2024, 5:25 PMGuilherme Delgado
04/26/2024, 5:29 PMStylianos Gakis
04/26/2024, 7:18 PMRafael Costa
04/26/2024, 7:34 PMRafael Costa
04/26/2024, 7:40 PMnavController.navigate(Destination(args).route)
Rafael Costa
04/26/2024, 7:40 PMRafael Costa
04/26/2024, 7:41 PMnavController.navigator.navigate(Destination(args))
Rafael Costa
04/26/2024, 7:42 PMArkadii Ivanov
04/26/2024, 8:03 PMStylianos Gakis
04/26/2024, 8:55 PMFor example, we have a unique requirement to change language on the fly without leaving the app or restarting itIsnโt that just changing the language of the app normally through
AppCompatDelegate.setApplicationLocales()
but then also making sure you have locale change as part of the configuration change types that you handle in your manifest?
Which would also then work with per-app language preferences changed from the OS settings and so on?Rafael Costa
04/26/2024, 8:57 PMStylianos Gakis
04/26/2024, 9:02 PMRafael Costa
04/26/2024, 9:05 PMRafael Costa
04/26/2024, 9:06 PMRafael Costa
04/26/2024, 9:06 PMStylianos Gakis
04/26/2024, 9:06 PMI may be missing something for your particular requirementsNarrator: He was in fact missing more of those particular requirements
Rafael Costa
04/26/2024, 9:10 PMprivate val navigators: WeakHashMap<NavController, DestinationsNavigator> = WeakHashMap()
val NavController.navigator: DestinationsNavigator
get(): DestinationsNavigator {
return navigators[this] ?: DestinationsNavController(this)
.also { navigators[this] = it }
}
Rafael Costa
04/26/2024, 9:10 PMnavigator
.Rafael Costa
04/26/2024, 9:11 PMGuilherme Delgado
04/26/2024, 9:26 PMRootComponent
and ComponentContext
which btw:
โฆNo need to extend a class from the library, or implement an interface.๐
Guilherme Delgado
04/26/2024, 9:27 PMprivate val navigators: WeakHashMap<NavController, DestinationsNavigator> = WeakHashMap()
val NavController.navigator: DestinationsNavigator
get(): DestinationsNavigator {
return navigators[this] ?: DestinationsNavController(this)
.also { navigators[this] = it }
}in which situations we end up with more than one navcontroller? ๐ค Normally I do
val navController = engine.rememberNavController()
I may be missing something ๐
Rafael Costa
04/26/2024, 9:28 PMRafael Costa
04/26/2024, 9:30 PMGuilherme Delgado
04/26/2024, 9:32 PMDestinationsNavHost
for the app (single activity).Guilherme Delgado
04/26/2024, 9:32 PMGuilherme Delgado
04/26/2024, 9:32 PMGuilherme Delgado
04/26/2024, 9:34 PMGuilherme Delgado
04/26/2024, 9:34 PMRafael Costa
04/26/2024, 9:34 PM.navigator
calls, they don't need to worry about instantiating a new instance every time.
I guess if he is inside a Composable doing an animation, that could be too much? Although If inside a Composable is the only case for this, I can just use remember
Suhaib Kazi
04/29/2024, 6:16 AMRafael Costa
04/29/2024, 8:16 AM