Philipp, I've no words!!!! Thank you for brightening my day! But mostly thank you for the truly TREMENDOUS amount of work you're doing to bring all those updates to us in a manner that's both timely and incredibly clear. Just... Thank you!!!!
Could you please make a video about Drawer/BottomNav using this lib? Especially how you would handle the selected-property of a nav-item (and the corresponding icons)
That JSON serialization is how I did before for passing argument. Though my approach on serialization & deserialization boilerplate can be ugly. Agree that it is a great improvement. I wish they made this available since the beginning.
I was using Circuit and it's own navigation, so I've been making use of type-safe screens with painless parcelable arguments for quite a while. It's nice to now see this present in the official library.
The demo is a pretty simplistic, but a good intro into the new Nav feature. In the real world you'd be getting the screen argument from savedstatehandle. Keep up the good work Phillipp, your videos have saved me hours. Thank you.
Thanks for keeping us updated on new stuff. The eco system changes so fast in Android, and there really isn't many youtubers keeping up but atleast we have you :D
There was a crash when we try to pass custom type like User(val id: Int, val name:String, val isPremium) in 2.8.0-alpha08 version which is fixed recently in version 2.8.0-beta01.
2 reasons why I started and stopped Android dev within a year: 1. Lack of a package manager that handles all package installations, they're dependencies and versions without having to manually do it every time and manually tweaking package and dependency versions 2. Navigation between screens The second one seems to be solved. If the first one gets solved, I'd be back to Android dev in a heartbeat
Native android development is much much better than iOS development. If you look at iOS development they don't even follow basic architecture in app development, No DI and no proper guide for modernization and app architecture. Even in their Switch UI they have restrictions like you can use this kind of code in ios17 only and other type of library in ios 15 and above like things whereas Compose is backward compatable and you can literally use even in low Android versions but in iOS even for basic recyclable or lazy Hstack or Vstaco you can only use in iOS 14+, if you want to use iOS13 or less you can only use Hstack not it's lazy property even though recycling in vertical and horizontal list is the most basic thing and they are making ios version dependent development packages. They just launched SwiftData but the catch is you can use it in iOS17+. Tell me why will you migrate or even think of using their latest library in your production code as it will only work in iOS17 and above??? You won't even dare to update into latest packages. Whereas Android libraries are always backward compatable, it's not like if they launch Room2.0 then they will say things like it will only work above Android 15 or something... Even they pro idea fully fledged app written with latest libraries, look at their "Android now" github repository, it has app modularization, app architecture, case studies and product flavors and even this app production code is in prllay store... iOS Apple documentation have no such teams to provides these kind of things, they only have basic single screen app and that's alos without any architecture... Native android development is much matured with jetpack libraries and their own source code than many other frameworks at present.... They even update their github repository actively...
Philip , thanks a lot for your videos! We followed this sample of navigation and we are struggling with an issue. When the user selects an item from the first screen, the detail screen is shown. Pressing the back button returns to the first screen, but the focus is reset. I want to keep the focus in place when returning to the first screen. What could be wrong? Is there a clean and easy way to achieve this? I mention it is a Tv app and we work a lot with focus
Just use Reimagined Navigation that has a bunch of cool features such as type-safe navigaiton and Parcelable support out of the box. Also community have the Decompose as a multiplatform solution. Both of these libraries are completely driven by community so if you prefer only official libraries it's always OK
No one takes the pains of using community libraries in their enterprise projects. We create our own solutions. Only indie developers or freelancers use these things in small projects or the types of projects they want to deliver as soon as possible. For scalable projects, no one takes these kinds of risks to resolve issues with community libraries. They either use snippets of them instead of using the entire libraries or the most famous ones with big organization repos, such as Retrofit, Coil, Glide, and so on....
@@deepakbisht4957 That is the main issue with multiplatform solutions. It's a continuous fight over efficiency in platform independency during a much larger generalized fight over market share between Google and Apple. If you don't want or can't permit the risks one sets up more robust native codebases. Especially consulted governments and companies.
Hi Philipp, does it work the same with a ScreenC, a route from screenA to C? Does it change anything for the return button? This video is BIG help thanks so much
Still nice improvement however the main advantage of f.e. voyager is that you do not need to declare the navHost and its all routes. Voyager allows you to just jump from ScreenA to ScreenB without declaring it in your navHost. Google's navigation is still kinda similar to the fragment navgraph but without the childlish arrowing thing.
Well, if, for example, you want to get screen objects from the DI graph, or some other data from the graph, won't this cause various kinds of problems, as it happens when using Voyager
But how can I check the currentDestination using Type-Safe Navigation? For example, I would like to check the selected item in the BottomNavigation which was previously done using a string. However, with Type-Safe Navigation, I'm unable to cast NavDestination to a Serializable object.
Great Video!!! How do you retrieve args from the destination viewModel directly? If I use savedStateHandle inside viewModel still needs to safe the possible null argument using ?: or !!
I am using ver rc01 and met a strange problem when passing two arguments in a data class object. The 2nd argument sticks the value of its first time usage, never changes in the afterward calls. I have to use the old way to get around this.
i'm trying so hard to understand where was the problem in passing arguments to screens till now? i mean I haven't tried passing anything except for the ViewModel instance. was that wrong? and if so, then how do I share same ViewModel instance with multiple screens (including nested navGraph)?
How do I reference the object into a navigation drawer argument? I keep getting crashes when I try to use a var to carry the object name into the navigation drawer item. Thanks
I have deployed 2 production apps which are used by Big Enterprises. I have used voyager and it's seamless till now. Is it worth moving to official library?
hi! how would i do it if i have 2 UI sets for 2 usertypes? i have a radiobutton on the signup to identify them. how can i navigate them to the right set of UIs i already have my bottomnav that has 5 screens
I am using this approach with shared element transition. When i am navigating from screen A to B. When entering in Screen B I click back button before transition complete the app is getting crashed.Why it is happening?
with this, do you create a separate file called and put in all data classes and objects? what would be a clean way to keep the screens? I have also thought of having a sealed class called Screens and then throwing all screens in there. curious to know what you suggest
Is there a way to gradually migrate to this meanwhile still keep the current navigation in xml? Simple the current project has large codebase and too difficult to migrate it in one shot.
Thanks again for that demo. Spot on, as always 👍 Originaly, it seemed that the routing library was made to handle all routes as deeplinks. I wonder how deeplinks will work with that new approach? Should we write a deeplink handler that would reroute the user to the proper screen? 🤔
but what will happen if theres multi module, like screen from Module A want to navigate to Module B and with Multiple Different Object the problem i cant import directly Module B to Module A it will cause circular dependency
@@rifatkhadafy9786 navigation setup doesn't belong in any module that's not the app module. For learning this properly, check my essentials bundle: pl-coding.com/android-essentials-bundle
OMG, I wish this could have come earlier. In my first app I have spent so much time and effort just to handle navigation without relying on 3rd party libraries. I have an e-commerce app running in production with lots of screens hanging on those route strings. It's time to refactor and remove all that boilerplate code.
I've add it to my project and it works really well but now I'm flooding with logcat message : "updateAcquireFence: Did not find frame." This doesn't crash the app or anything, but it's really annoying.
@@PhilippLackner yes but only single args as a string. What if we need the whole data class as a param in a view model? I guess assisted injection come to the rescue
Yes. Yes. Yes. Omg. Tears of joy. Really needed a new way!!!!!
7:17 He sounds so happy about it 😭
yea... I felt that in his voice 😄
😂😂 I felt that too
X3
its like every developer after a new good feature
Cause this feature reduces hundreds of lines of boilerplate parsing arguments, ensuring they're not null, etc...
Philipp, I've no words!!!! Thank you for brightening my day! But mostly thank you for the truly TREMENDOUS amount of work you're doing to bring all those updates to us in a manner that's both timely and incredibly clear. Just... Thank you!!!!
🙌❤️
This is actually the best news in android i've heard in a really long while
Could you please make a video about Drawer/BottomNav using this lib? Especially how you would handle the selected-property of a nav-item (and the corresponding icons)
That JSON serialization is how I did before for passing argument.
Though my approach on serialization & deserialization boilerplate can be ugly.
Agree that it is a great improvement. I wish they made this available since the beginning.
4:03 we can clearly see his happiness.
Such a relief, I need this to be in compose stable
Finally .. a simple straight routing .. 😊
If you were in tears, I'm crying right now hehe. Love it, thanks a lot!
I was using Circuit and it's own navigation, so I've been making use of type-safe screens with painless parcelable arguments for quite a while.
It's nice to now see this present in the official library.
The demo is a pretty simplistic, but a good intro into the new Nav feature. In the real world you'd be getting the screen argument from savedstatehandle. Keep up the good work Phillipp, your videos have saved me hours. Thank you.
Thanks for keeping us updated on new stuff. The eco system changes so fast in Android, and there really isn't many youtubers keeping up but atleast we have you :D
Omg this feels much more satisfying to do nagivation straight with classes now. Beautiful update.
It's so easy now. Thank you for bringing this content to us! Keep up the great work, hugs from Brazil.
Finally! As soon as the stable release is out I will implement it.
Wow wow wow.... tears in my eyes as well.
So excited to try this.
There was a crash when we try to pass custom type like User(val id: Int, val name:String, val isPremium) in 2.8.0-alpha08 version which is fixed recently in version 2.8.0-beta01.
2 reasons why I started and stopped Android dev within a year:
1. Lack of a package manager that handles all package installations, they're dependencies and versions without having to manually do it every time and manually tweaking package and dependency versions
2. Navigation between screens
The second one seems to be solved. If the first one gets solved, I'd be back to Android dev in a heartbeat
Native android development is much much better than iOS development.
If you look at iOS development they don't even follow basic architecture in app development, No DI and no proper guide for modernization and app architecture.
Even in their Switch UI they have restrictions like you can use this kind of code in ios17 only and other type of library in ios 15 and above like things whereas Compose is backward compatable and you can literally use even in low Android versions but in iOS even for basic recyclable or lazy Hstack or Vstaco you can only use in iOS 14+, if you want to use iOS13 or less you can only use Hstack not it's lazy property even though recycling in vertical and horizontal list is the most basic thing and they are making ios version dependent development packages.
They just launched SwiftData but the catch is you can use it in iOS17+. Tell me why will you migrate or even think of using their latest library in your production code as it will only work in iOS17 and above???
You won't even dare to update into latest packages. Whereas Android libraries are always backward compatable, it's not like if they launch Room2.0 then they will say things like it will only work above Android 15 or something...
Even they pro idea fully fledged app written with latest libraries, look at their "Android now" github repository, it has app modularization, app architecture, case studies and product flavors and even this app production code is in prllay store...
iOS Apple documentation have no such teams to provides these kind of things, they only have basic single screen app and that's alos without any architecture...
Native android development is much matured with jetpack libraries and their own source code than many other frameworks at present....
They even update their github repository actively...
It was really a big problem for beginners for me to change the screen and you made it easy now
Just wrapped up a project that used a lot of the old compose navigation. Looking forward to this
Philip , thanks a lot for your videos! We followed this sample of navigation and we are struggling with an issue.
When the user selects an item from the first screen, the detail screen is shown. Pressing the back button returns to the first screen, but the focus is reset. I want to keep the focus in place when returning to the first screen. What could be wrong? Is there a clean and easy way to achieve this? I mention it is a Tv app and we work a lot with focus
Finally some good updates, finally so much relief after this update
This looks similar, but even better than Decompose. As always, thanks for sharing these great videos and quality content!
What if I need this parameters on ViewModel?
Thanks who created this, thanks Phillips ❤ That's what we're waiting for
Thanks for the video. Is the bottom navigation also changing accordingly? What is needed to have screenB with bottom navigation graphs? Thanks.
being as Android Native Developer appreciate 👍 you
Just use Reimagined Navigation that has a bunch of cool features such as type-safe navigaiton and Parcelable support out of the box. Also community have the Decompose as a multiplatform solution. Both of these libraries are completely driven by community so if you prefer only official libraries it's always OK
No one takes the pains of using community libraries in their enterprise projects.
We create our own solutions.
Only indie developers or freelancers use these things in small projects or the types of projects they want to deliver as soon as possible.
For scalable projects, no one takes these kinds of risks to resolve issues with community libraries.
They either use snippets of them instead of using the entire libraries or the most famous ones with big organization repos, such as Retrofit, Coil, Glide, and so on....
@@deepakbisht4957 That is the main issue with multiplatform solutions. It's a continuous fight over efficiency in platform independency during a much larger generalized fight over market share between Google and Apple. If you don't want or can't permit the risks one sets up more robust native codebases. Especially consulted governments and companies.
The questino is in my view model how would I use savedStateHandle to extract the parameters?
Amazing ! I'm already making a PR on my projec with theses improvments 😁
Thanks @Philipp Lackner, one thing I have to mention is we can't send empty string as value, I am using 2.8.0-beta01.
With "empty string" do you mean:
1.a text with no characters; like ""
2. or do you mean undefined
3. or do you mean null
@@SunAndMoon-zc9vd I mean "" this
Hi Philipp, does it work the same with a ScreenC, a route from screenA to C? Does it change anything for the return button? This video is BIG help thanks so much
Philip my guy, this is awesome... love all your work
Shouldn't we store those composables for different screens in separate files? Maybe I'm just thinking in old Fragment style though
Uff faltan tutoriales asi en español, gracias a youtube por los subtítulos! Estaba buscando entender esto y solo con tu video pude
Still nice improvement however the main advantage of f.e. voyager is that you do not need to declare the navHost and its all routes. Voyager allows you to just jump from ScreenA to ScreenB without declaring it in your navHost. Google's navigation is still kinda similar to the fragment navgraph but without the childlish arrowing thing.
Thanks for the video! So exciting! I have a question, does it automatically work with SavedStateHandle in a ViewModel?
I did today and worked well. but you should use the method now like "SavedStateHandle.toRoute" not just "savedStateHandle" in a ViewModel.
Thank you for bringing this content in a very didactic way
Well, if, for example, you want to get screen objects from the DI graph, or some other data from the graph, won't this cause various kinds of problems, as it happens when using Voyager
It's also working for KMP Compose, but do you know of a way to enable swipe-to-back gesture on iOS which natively works on iOS UINavigationController?
hay un error en el OnRestart cuando la activity se pausa por poca ram y se ejecuta el onRestar manda error de restoring back stack alguien le paso?
Hi Philip, can you make a video about drag and drop of lazy column, i have stuck there. It seems they have recently added this capability.
But how can I check the currentDestination using Type-Safe Navigation? For example, I would like to check the selected item in the BottomNavigation which was previously done using a string. However, with Type-Safe Navigation, I'm unable to cast NavDestination to a Serializable object.
Now we need another navigation video to compare all the options with pros and cons for each 😄
Can you make a video on how to implement this way of navigation, using a navigation drawer for example or a bottom nav bar?
Could you please explain how we can safely integrate vertex AI into the application with Google Cloud Console. I need this urgently.
Which theme you are using in the android studio, It's awsome..!
Finally. Thank you Philipp
Even more relevant as of July 3rd, since JetBrains released version 2.8.0-alpha08 of their KMP compatible version of navigation-compose.
Great Video!!! How do you retrieve args from the destination viewModel directly? If I use savedStateHandle inside viewModel still needs to safe the possible null argument using ?: or !!
hi Philipp, is nice video, Could you please tell us if this new approach to navigation works well as well with bottom bar navigation ?
I am using ver rc01 and met a strange problem when passing two arguments in a data class object. The 2nd argument sticks the value of its first time usage, never changes in the afterward calls. I have to use the old way to get around this.
I used a json + simple kotlin class to get around this.
shouldn't need to tho...
Can we use this in KMP?
Is Kotlin Multi-Platform industry ready?
Can I migrate my Flutter project to KMP?
i'm trying so hard to understand where was the problem in passing arguments to screens till now? i mean I haven't tried passing anything except for the ViewModel instance. was that wrong? and if so, then how do I share same ViewModel instance with multiple screens (including nested navGraph)?
How do I reference the object into a navigation drawer argument? I keep getting crashes when I try to use a var to carry the object name into the navigation drawer item. Thanks
I have deployed 2 production apps which are used by Big Enterprises. I have used voyager and it's seamless till now.
Is it worth moving to official library?
Very good, my project is in its final stages. I'm going to take advantage and refactor it to be cleaner. Thank you very much friend.
Havent had the chance to play with this yet. How does it deal with deeplinks? And is this implemented for kmp compose?
Is it possible to use that with nested graphs?
hi! how would i do it if i have 2 UI sets for 2 usertypes? i have a radiobutton on the signup to identify them. how can i navigate them to the right set of UIs i already have my bottomnav that has 5 screens
Any tips on naming? I already use FooScreen for the actual composable UI.
I am using this approach with shared element transition. When i am navigating from screen A to B. When entering in Screen B I click back button before transition complete the app is getting crashed.Why it is happening?
Where is type-safe bottom sheet navigation? I don't see it in the docs. So for now we can't use type-safe navigation at all?
Will the object be injected to viewmodel like it used to inject with the parameters when using hilt?
private val ScreenA = savedStateHandle.toRoute()
I wonder how other libraries (mentioned in the comments) can get use out of Parcelable. For KMP. I thought It was only android thing
Haha I can relate to your joy about this update so much 😂Great video!
It looks fine with two screens, what about popBackStack , popupTo etc, like in fragments ? When nav logic becomes more complex
Works just as easy
with this, do you create a separate file called and put in all data classes and objects? what would be a clean way to keep the screens? I have also thought of having a sealed class called Screens and then throwing all screens in there. curious to know what you suggest
I personally replaced sealed class with sealed interface and moved all serialized objects & classes to it
Is there a way to gradually migrate to this meanwhile still keep the current navigation in xml? Simple the current project has large codebase and too difficult to migrate it in one shot.
Thanks again for that demo. Spot on, as always 👍
Originaly, it seemed that the routing library was made to handle all routes as deeplinks. I wonder how deeplinks will work with that new approach? Should we write a deeplink handler that would reroute the user to the proper screen? 🤔
Aaaaand thanks again for sharing man! 🎉🎉🎉
How can we navigate to pop backstack from screenB to screenA with some arguments, please explain
Thanks philip ,you are really amazing.
We can use it in prod apps ? its on alpha or you recommend to use it from now on
How do I navigate between two graps containing two screens each usi g type safety? Im confused. Please make a video on this.
with this approach how can we do a shared transition between screens?
Can I use the library normally in kmm?
Is it superior to voyager and decompose?
Is this the best navigation for Compose Multiplatform?
I once said XML way of navigating was better than Compose. Now it's getting better. 😀
but what will happen if theres multi module,
like screen from Module A want to navigate to Module B and with Multiple Different Object
the problem
i cant import directly Module B to Module A it will cause circular dependency
@@rifatkhadafy9786 navigation setup doesn't belong in any module that's not the app module. For learning this properly, check my essentials bundle:
pl-coding.com/android-essentials-bundle
how to use this with multi module project with feature modules not depending on each other just like android recommends?
I have purchased Essentials course. Will this be incorporated in the course as well?
Thanks Philipp! This is amazing!
looking forward you make a video about this but with multiple nested graph. im newbie and im so confuse right now.
Isn't it still not ideal that you have to do NavBackStackEntry.toRoute()? like you could accidentally you use the wrong class surely?
Is this out for Compose Multiplatform yet? Great video!
OMG, I wish this could have come earlier. In my first app I have spent so much time and effort just to handle navigation without relying on 3rd party libraries.
I have an e-commerce app running in production with lots of screens hanging on those route strings. It's time to refactor and remove all that boilerplate code.
I've add it to my project and it works really well but now I'm flooding with logcat message : "updateAcquireFence: Did not find frame." This doesn't crash the app or anything, but it's really annoying.
Hi there, did you manage to fix it? It's happening to me also
Same problem
Hey Philip, how do you keep updated with all these new features from each library?
Android docs, Twitter, blogs, etc
@@PhilippLackner but who do you follow on twitter? Or which blogs? Thank you.
thanks for video. Is this new lib support compose Multiplatform ?
I was wondering how to migrate the code when using it with BottomNavigation or NestedNavigation
how to use this with navGraph? since it asks for string in the start destination.
and we're passing object here.
Navgraphs are also objects with this change
Good information Phillip ! Thos wpuld really helped my ptoject for compose multiplatform
Wow, this really is a lot easier than it used to be
is it also available for KMM?
I am Big fan of yours video 🎉
Nice but how can we achieve this if we are using dependency injection and need these args in a view model?
They're still part of saved state handle
@@PhilippLackner yes but only single args as a string. What if we need the whole data class as a param in a view model?
I guess assisted injection come to the rescue
how does this work on a nested navigation?