Type-Safe Navigation with the OFFICIAL Compose Navigation Library

  Рет қаралды 61,258

Philipp Lackner

Philipp Lackner

Күн бұрын

In this video I'll show you the Type-Safe Navigation with the OFFICIAL Compose Navigation Library!
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/...
⭐ Courses with real-life practices
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/...
Regular programming advice on my Instagram page: / _philipplackner_
Join my Discord server:
/ discord
Get the source code for this video on GitHub:
github.com/phi...

Пікірлер: 258
@sosaucemp3
@sosaucemp3 4 ай бұрын
7:17 He sounds so happy about it 😭
@WakeupDev.
@WakeupDev. 4 ай бұрын
yea... I felt that in his voice 😄
@farfar5828
@farfar5828 4 ай бұрын
😂😂 I felt that too
@KevinMeneses
@KevinMeneses 4 ай бұрын
X3
@BSS_00
@BSS_00 4 ай бұрын
its like every developer after a new good feature
@ilyastoletov
@ilyastoletov 4 ай бұрын
Cause this feature reduces hundreds of lines of boilerplate parsing arguments, ensuring they're not null, etc...
@Shengdanya
@Shengdanya 4 ай бұрын
Yes. Yes. Yes. Omg. Tears of joy. Really needed a new way!!!!!
@nanonkay5669
@nanonkay5669 3 ай бұрын
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
@ayitinya
@ayitinya 4 ай бұрын
This is actually the best news in android i've heard in a really long while
@annaberkovitch85
@annaberkovitch85 4 ай бұрын
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!!!!
@PhilippLackner
@PhilippLackner 4 ай бұрын
🙌❤️
@lindaporsius
@lindaporsius 4 ай бұрын
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)
@JackCheungShingKit
@JackCheungShingKit 4 ай бұрын
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.
@rishabhsaraswat1928
@rishabhsaraswat1928 4 ай бұрын
4:03 we can clearly see his happiness.
@Jessewb786
@Jessewb786 4 ай бұрын
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.
@amit470
@amit470 4 ай бұрын
Such a relief, I need this to be in compose stable
@magedahmed5981
@magedahmed5981 4 ай бұрын
Finally .. a simple straight routing .. 😊
@raeesmohit01
@raeesmohit01 4 ай бұрын
It was really a big problem for beginners for me to change the screen and you made it easy now
@vit4mint685
@vit4mint685 4 ай бұрын
Just wrapped up a project that used a lot of the old compose navigation. Looking forward to this
@ilyastoletov
@ilyastoletov 4 ай бұрын
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
@worthex_2
@worthex_2 4 ай бұрын
Omg this feels much more satisfying to do nagivation straight with classes now. Beautiful update.
@MatthewSmith-mt3kz
@MatthewSmith-mt3kz 4 ай бұрын
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.
@geanbrandao4987
@geanbrandao4987 4 ай бұрын
It's so easy now. Thank you for bringing this content to us! Keep up the great work, hugs from Brazil.
@moheltanani1036
@moheltanani1036 4 ай бұрын
If you were in tears, I'm crying right now hehe. Love it, thanks a lot!
@coalacorey
@coalacorey 4 ай бұрын
Finally! As soon as the stable release is out I will implement it.
@supadeurali9848
@supadeurali9848 4 ай бұрын
Wow wow wow.... tears in my eyes as well. So excited to try this.
@9Blurke9
@9Blurke9 4 ай бұрын
Now we need another navigation video to compare all the options with pros and cons for each 😄
@paulklein649
@paulklein649 4 ай бұрын
do somebody still wish to work for google and develop shitty frameworks and libs and maybe correct them 2 years later to be somewhat usable? I have the feeling that every dev-product google provides is garbage if jetbrains is not involved in the development
@BigCarso
@BigCarso 2 ай бұрын
What about Compose? Probably the best UI framework in existence
@paulklein649
@paulklein649 2 ай бұрын
@@BigCarso yeah. You mean jetbrains compose just relabeled for android
@BigCarso
@BigCarso Ай бұрын
@@paulklein649 ok you have no idea what you're talking about. Compose was developed by Google team, not Jetbrains
@stijndcl
@stijndcl Ай бұрын
​@@paulklein649 ? JetBrains made compose multiplatform years after the android version, and most of it is a 1:1 port of jetpack compose. Not sure what you're on about with that.
@Mexicanerie
@Mexicanerie 4 ай бұрын
Amazing ! I'm already making a PR on my projec with theses improvments 😁
@ASTAppLab
@ASTAppLab 4 ай бұрын
being as Android Native Developer appreciate 👍 you
@Zscor27
@Zscor27 2 ай бұрын
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
@vengateshm2122
@vengateshm2122 4 ай бұрын
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.
@MateuszKowol-nu8lr
@MateuszKowol-nu8lr 4 ай бұрын
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.
@yahussainmazloom1
@yahussainmazloom1 4 ай бұрын
Finally some good updates, finally so much relief after this update
@okeziokezino
@okeziokezino 4 ай бұрын
Philip my guy, this is awesome... love all your work
@siftoshka
@siftoshka 4 ай бұрын
What if I need this parameters on ViewModel?
@joatancarlos2704
@joatancarlos2704 4 ай бұрын
Thank you for bringing this content in a very didactic way
@TimKaragosian
@TimKaragosian 4 ай бұрын
This looks similar, but even better than Decompose. As always, thanks for sharing these great videos and quality content!
@quangthaita6084
@quangthaita6084 4 ай бұрын
Thanks who created this, thanks Phillips ❤ That's what we're waiting for
@TheRobertJamison
@TheRobertJamison 3 ай бұрын
Even more relevant as of July 3rd, since JetBrains released version 2.8.0-alpha08 of their KMP compatible version of navigation-compose.
@douglascf2
@douglascf2 4 ай бұрын
Thanks for the video! So exciting! I have a question, does it automatically work with SavedStateHandle in a ViewModel?
@jeonie9682
@jeonie9682 4 ай бұрын
I did today and worked well. but you should use the method now like "SavedStateHandle.toRoute" not just "savedStateHandle" in a ViewModel.
@MO1NKHAN
@MO1NKHAN 4 ай бұрын
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.
@AntliaRodriguez-d9t
@AntliaRodriguez-d9t 2 ай бұрын
Uff faltan tutoriales asi en español, gracias a youtube por los subtítulos! Estaba buscando entender esto y solo con tu video pude
@meidy3795
@meidy3795 4 ай бұрын
Good information Phillip ! Thos wpuld really helped my ptoject for compose multiplatform
@filipmanevski9872
@filipmanevski9872 4 ай бұрын
Can you make a video on how to implement this way of navigation, using a navigation drawer for example or a bottom nav bar?
@aiyuayaan
@aiyuayaan 4 ай бұрын
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.
@SunAndMoon-zc9vd
@SunAndMoon-zc9vd 4 ай бұрын
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
@aiyuayaan
@aiyuayaan 4 ай бұрын
@@SunAndMoon-zc9vd I mean "" this
@MultiDeivas
@MultiDeivas 3 ай бұрын
It seems like the NavHost causes memory leaks on configuration changes, lovely :)
@planet3a
@planet3a 4 ай бұрын
I once said XML way of navigating was better than Compose. Now it's getting better. 😀
@normno
@normno 4 ай бұрын
Так забавно наблюдать, как мои любимые yoytebers выпускают обзоры на новые функции библиотек android и kmp примерно в одно и тоже время и у каждого свое красивое решение использования.
@diabetesatuniversity
@diabetesatuniversity 4 ай бұрын
Thanks this is helpful. Love your videos.
@darknjko
@darknjko 4 ай бұрын
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? 🤔
@ordnavile
@ordnavile 4 ай бұрын
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.
@bierdav
@bierdav 2 ай бұрын
I would be the happiest developer in compose multiplatform land, if you make a video about "scalable" Type-Safe Navigation with best practises 😊 I find it hard to structure my compose multiplatform app, because somewhere I always have to mention all the navigation routes, but what if i have 40 of them? I can't image of way that isn't completely messy with this huge amount of screens
@MrMacromicro
@MrMacromicro 4 ай бұрын
Thanks philip ,you are really amazing.
@زيد_اليماني
@زيد_اليماني 4 ай бұрын
Wow, this really is a lot easier than it used to be
@tmjromao
@tmjromao 4 ай бұрын
Thanks for the video. Is the bottom navigation also changing accordingly? What is needed to have screenB with bottom navigation graphs? Thanks.
@upbeatsarcastic8217
@upbeatsarcastic8217 4 ай бұрын
This is most exciting Compose feature to date imo. Having just finished a Compose app, navigation was the ugliest thing to deal with by a long way.
@levlevkin1325
@levlevkin1325 4 ай бұрын
Thanks Philipp! This is amazing!
@kfirossmatityahu4295
@kfirossmatityahu4295 3 ай бұрын
So actually they got the motivation from Voyager!? (pushing classes as "screens") great!
@kuromujou1346
@kuromujou1346 4 ай бұрын
looking forward you make a video about this but with multiple nested graph. im newbie and im so confuse right now.
@MonichGPT
@MonichGPT 4 ай бұрын
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?
@manticomar1146
@manticomar1146 4 ай бұрын
The questino is in my view model how would I use savedStateHandle to extract the parameters?
@samuelwakoli
@samuelwakoli 4 ай бұрын
Is Kotlin Multi-Platform industry ready? Can I migrate my Flutter project to KMP?
@AKnght
@AKnght 2 ай бұрын
Is this out for Compose Multiplatform yet? Great video!
@rahathossainhimel7177
@rahathossainhimel7177 4 ай бұрын
Finally. Thank you Philipp
@youNeverThoughtAboutIt
@youNeverThoughtAboutIt 3 ай бұрын
Shouldn't we store those composables for different screens in separate files? Maybe I'm just thinking in old Fragment style though
@WakeupDev.
@WakeupDev. 4 ай бұрын
Lucky me.. I just started doing compose and KMP, so I haven't suffered like you 😄 I see some cool changes
@JamesShisiah
@JamesShisiah 2 ай бұрын
Haha, me too.
@arthurabreu1904
@arthurabreu1904 4 ай бұрын
Aaaaand thanks again for sharing man! 🎉🎉🎉
@СергейБобошко-в2л
@СергейБобошко-в2л 2 ай бұрын
The strings arguments i could pass and old style way... The interesting example will be pass a data class. Somehow somewhen i'll try.
@danielreinhold8475
@danielreinhold8475 4 ай бұрын
Looks pretty nice, but in my opinion compose destinations by raamcosta is still easier to use & maintain.
@oneclickmobiledevelopers7825
@oneclickmobiledevelopers7825 3 ай бұрын
Which theme you are using in the android studio, It's awsome..!
@LEEJIHUN
@LEEJIHUN 4 ай бұрын
I was wondering how to migrate the code when using it with BottomNavigation or NestedNavigation
@yanneckreiss
@yanneckreiss 4 ай бұрын
Haha I can relate to your joy about this update so much 😂Great video!
@Pulkit__7
@Pulkit__7 4 ай бұрын
KotlinX Serialization brings back old memories from 2019
@radheshyampatel5578
@radheshyampatel5578 4 ай бұрын
I am Big fan of yours video 🎉
@pablovaldes6022
@pablovaldes6022 4 ай бұрын
Still a lot to improve. Dynamic load of graph in other libraries or modules, without the need to load all them upfront.
@wilkq1110
@wilkq1110 2 ай бұрын
hi Philipp, is nice video, Could you please tell us if this new approach to navigation works well as well with bottom bar navigation ?
@arten8281
@arten8281 4 ай бұрын
OP gonna start using jet pack compose now
@amirhosseinghafoorian9985
@amirhosseinghafoorian9985 4 ай бұрын
Cool update 🤩 what I'm more curious about is that how does recommendations work ? is it an extension or a live template or smth ?
@PhilippLackner
@PhilippLackner 4 ай бұрын
Gemini AI suggestions in Android Studio Jellyfish
@Raluca.Lucaci
@Raluca.Lucaci 10 күн бұрын
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
@portusdelphini
@portusdelphini 3 ай бұрын
In a prospect of front end routing this looks like a hell. Still a question why it's so complicated?
@BugraKaraahmetoglu
@BugraKaraahmetoglu 4 ай бұрын
Could you please explain how we can safely integrate vertex AI into the application with Google Cloud Console. I need this urgently.
@bitoons
@bitoons 4 ай бұрын
So cool and so safe !! But now how i can use deeplink with this serialize data road ?
@resitsahin7787
@resitsahin7787 4 ай бұрын
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.
@PratikSahu18
@PratikSahu18 4 ай бұрын
Will the object be injected to viewmodel like it used to inject with the parameters when using hilt?
@BorisJakubov
@BorisJakubov 4 ай бұрын
private val ScreenA = savedStateHandle.toRoute()
@markocicak4004
@markocicak4004 6 күн бұрын
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?
@ntikomathaba2662
@ntikomathaba2662 3 ай бұрын
Is this the best navigation for Compose Multiplatform?
@siddharthshakya09
@siddharthshakya09 2 ай бұрын
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?
@ubersticks
@ubersticks 4 ай бұрын
I love Compose and Kotlin in general, but the navigation "solution" seemed so half-baked and clunky until now. This seems so elegant.
@slyene6202
@slyene6202 23 күн бұрын
Please, if you have such code, let us see how to create custom nullable arguments (NavType's)!
@СенчуринНиколай
@СенчуринНиколай 4 ай бұрын
It looks fine with two screens, what about popBackStack , popupTo etc, like in fragments ? When nav logic becomes more complex
@PhilippLackner
@PhilippLackner 4 ай бұрын
Works just as easy
@santyas
@santyas 4 ай бұрын
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 !!
@patsnow1066
@patsnow1066 4 ай бұрын
Need this in KMM!
@aldourtusuastegui7717
@aldourtusuastegui7717 2 ай бұрын
amaizing, thank you!
@ryantcb
@ryantcb 2 ай бұрын
Really appreciate your videos. Moving over from iOS to learn JC and OMG we spoiled with Xcode. All this fluff that has to happen around implementing simple tasks like navigation. Genuinely unless they make working in the Android development more user friendly, I can see new devs just giving up and sticking to iOS. Such a headache. If it wasn't for your videos I wouldn't have made it past "Hello, World(Android)". Thank you
@chaitanyapenjuri
@chaitanyapenjuri Ай бұрын
How can we navigate to pop backstack from screenB to screenA with some arguments, please explain
@loklok2003
@loklok2003 3 ай бұрын
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.
@Lucky_PhilB
@Lucky_PhilB 4 ай бұрын
Havent had the chance to play with this yet. How does it deal with deeplinks? And is this implemented for kmp compose?
@unknownBoy85lover
@unknownBoy85lover 4 ай бұрын
The android SDK developmented by Google need a lot of changes in most of layers this API's are from them
4 ай бұрын
What an improvement!
@MrBzik1111
@MrBzik1111 4 ай бұрын
I wonder how other libraries (mentioned in the comments) can get use out of Parcelable. For KMP. I thought It was only android thing
@Ayor88
@Ayor88 4 ай бұрын
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.
@Matthew01369
@Matthew01369 4 ай бұрын
Hi there, did you manage to fix it? It's happening to me also
@vsv8161
@vsv8161 3 ай бұрын
Same problem
@lazydeveloper7753
@lazydeveloper7753 4 ай бұрын
How do I navigate between two graps containing two screens each usi g type safety? Im confused. Please make a video on this.
@Guilo583
@Guilo583 4 ай бұрын
thanks for video. Is this new lib support compose Multiplatform ?
@rishabhsaraswat1928
@rishabhsaraswat1928 4 ай бұрын
I am a student. I am up to date with most of Android and I am struggling with guidance for more advanced stuff. Since I am a student, can u please tell the price of the 10 week program. I need to start collecting money. I have signed up but haven't received any emails yet.
@rhen4610
@rhen4610 4 ай бұрын
I hope the migration from Ram's library to this wouldnt be a hassle
Bottom Navigation Bar - Android Studio | Fragments | Java | 2023
13:29
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
Players vs Corner Flags 🤯
00:28
LE FOOT EN VIDÉO
Рет қаралды 90 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 274 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 69 МЛН
Navigation Compose meet Type Safety
16:50
Android Developers
Рет қаралды 12 М.
Performance Optimization with @Stable and @Immutable in Jetpack Compose
16:47
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 78 М.
Kotlin Multiplatform vs Flutter: Which should we use?
4:42
Kei Fujikawa
Рет қаралды 23 М.
Full Stack Developers will take over. This is why.
11:26
Ed Andersen
Рет қаралды 55 М.
ChatGPT-o1 Created A Programming Language...
19:45
Conner Ardman
Рет қаралды 78 М.
How Much FASTER Is Python 3.13 Without the GIL?
10:00
ArjanCodes
Рет қаралды 161 М.
This Is My FAVORITE Error Handling Class
28:57
Philipp Lackner
Рет қаралды 31 М.
😍Самый ПРИЯТНЫЙ Айфон🔥
0:34
Demin's Lounge
Рет қаралды 709 М.
Apple designers updating the iPhone design 😫
0:26
Hassan Said
Рет қаралды 7 МЛН
Xiaomi 15 - АЙФОН ТЕПЕРЬ ДЛЯ НИЩЕБРОДОВ…
12:30
Thebox - о технике и гаджетах
Рет қаралды 89 М.
Умный обзор умного iPhone 16 / 16 Pro
21:21
Гуфовский
Рет қаралды 425 М.