Тёмный

Type-Safe Navigation with the OFFICIAL Compose Navigation Library 

Philipp Lackner
Подписаться 183 тыс.
Просмотров 60 тыс.
50% 1

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...

Наука

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 256   
@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 3 месяца назад
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!!!!!
@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 месяца назад
🙌❤️
@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
@rishabhsaraswat1928
@rishabhsaraswat1928 4 месяца назад
4:03 we can clearly see his happiness.
@magedahmed5981
@magedahmed5981 4 месяца назад
Finally .. a simple straight routing .. 😊
@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.
@amit470
@amit470 4 месяца назад
Such a relief, I need this to be in compose stable
@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.
@moheltanani1036
@moheltanani1036 3 месяца назад
If you were in tears, I'm crying right now hehe. Love it, thanks a lot!
@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.
@worthex_2
@worthex_2 4 месяца назад
Omg this feels much more satisfying to do nagivation straight with classes now. Beautiful update.
@raeesmohit01
@raeesmohit01 4 месяца назад
It was really a big problem for beginners for me to change the screen and you made it easy now
@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
@geanbrandao4987
@geanbrandao4987 4 месяца назад
It's so easy now. Thank you for bringing this content to us! Keep up the great work, hugs from Brazil.
@supadeurali9848
@supadeurali9848 4 месяца назад
Wow wow wow.... tears in my eyes as well. So excited to try this.
@coalacorey
@coalacorey 4 месяца назад
Finally! As soon as the stable release is out I will implement it.
@9Blurke9
@9Blurke9 4 месяца назад
Now we need another navigation video to compare all the options with pros and cons for each 😄
@yahussainmazloom1
@yahussainmazloom1 4 месяца назад
Finally some good updates, finally so much relief after this update
@ASTAppLab
@ASTAppLab 4 месяца назад
being as Android Native Developer appreciate 👍 you
@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)
@quangthaita6084
@quangthaita6084 4 месяца назад
Thanks who created this, thanks Phillips ❤ That's what we're waiting for
@TheRobertJamison
@TheRobertJamison 2 месяца назад
Even more relevant as of July 3rd, since JetBrains released version 2.8.0-alpha08 of their KMP compatible version of navigation-compose.
@normno
@normno 4 месяца назад
Так забавно наблюдать, как мои любимые yoytebers выпускают обзоры на новые функции библиотек android и kmp примерно в одно и тоже время и у каждого свое красивое решение использования.
@joatancarlos2704
@joatancarlos2704 4 месяца назад
Thank you for bringing this content in a very didactic way
@okeziokezino
@okeziokezino 4 месяца назад
Philip my guy, this is awesome... love all your work
@siftoshka
@siftoshka 4 месяца назад
What if I need this parameters on ViewModel?
@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.
@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
@planet3a
@planet3a 4 месяца назад
I once said XML way of navigating was better than Compose. Now it's getting better. 😀
@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.
@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.
@meidy3795
@meidy3795 4 месяца назад
Good information Phillip ! Thos wpuld really helped my ptoject for compose multiplatform
@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.
@MrMacromicro
@MrMacromicro 4 месяца назад
Thanks philip ,you are really amazing.
@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.
@diabetesatuniversity
@diabetesatuniversity 4 месяца назад
Thanks this is helpful. Love your videos.
@زيد_اليماني
@زيد_اليماني 4 месяца назад
Wow, this really is a lot easier than it used to be
@yanneckreiss
@yanneckreiss 4 месяца назад
Haha I can relate to your joy about this update so much 😂Great video!
@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.
@bierdav
@bierdav Месяц назад
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
@rahathossainhimel7177
@rahathossainhimel7177 4 месяца назад
Finally. Thank you Philipp
@СергейБобошко-в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.
@MultiDeivas
@MultiDeivas 3 месяца назад
It seems like the NavHost causes memory leaks on configuration changes, lovely :)
@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.
@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
@radheshyampatel5578
@radheshyampatel5578 4 месяца назад
I am Big fan of yours video 🎉
@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?
@arthurabreu1904
@arthurabreu1904 4 месяца назад
Aaaaand thanks again for sharing man! 🎉🎉🎉
@kfirossmatityahu4295
@kfirossmatityahu4295 3 месяца назад
So actually they got the motivation from Voyager!? (pushing classes as "screens") great!
@levlevkin1325
@levlevkin1325 4 месяца назад
Thanks Philipp! This is amazing!
@Pulkit__7
@Pulkit__7 4 месяца назад
KotlinX Serialization brings back old memories from 2019
@manticomar1146
@manticomar1146 4 месяца назад
The questino is in my view model how would I use savedStateHandle to extract the parameters?
@danielreinhold8475
@danielreinhold8475 3 месяца назад
Looks pretty nice, but in my opinion compose destinations by raamcosta is still easier to use & maintain.
@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?
@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.
@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
@arten8281
@arten8281 4 месяца назад
OP gonna start using jet pack compose now
@aldourtusuastegui7717
@aldourtusuastegui7717 2 месяца назад
amaizing, thank you!
@atharvapajgade4434
@atharvapajgade4434 Месяц назад
its finally here ;-; our time has come guys
@LEEJIHUN
@LEEJIHUN 4 месяца назад
I was wondering how to migrate the code when using it with BottomNavigation or NestedNavigation
@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.
@chaitanyapenjuri
@chaitanyapenjuri Месяц назад
How can we navigate to pop backstack from screenB to screenA with some arguments, please explain
@oneclickmobiledevelopers7825
@oneclickmobiledevelopers7825 3 месяца назад
Which theme you are using in the android studio, It's awsome..!
@portusdelphini
@portusdelphini 3 месяца назад
In a prospect of front end routing this looks like a hell. Still a question why it's so complicated?
@slyene6202
@slyene6202 14 дней назад
Please, if you have such code, let us see how to create custom nullable arguments (NavType's)!
4 месяца назад
What an improvement!
@samuelwakoli
@samuelwakoli 4 месяца назад
Is Kotlin Multi-Platform industry ready? Can I migrate my Flutter project to KMP?
@AKnght
@AKnght Месяц назад
Is this out for Compose Multiplatform yet? Great 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.
@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.
@wilkq1110
@wilkq1110 Месяц назад
hi Philipp, is nice video, Could you please tell us if this new approach to navigation works well as well with bottom bar navigation ?
@notch_àpple_op
@notch_àpple_op 4 месяца назад
I really need say *BRUH* The productivity with jetpack Compose is 📈📈📈📈📈 I was the only Android developer in my COMPANY Their emotions with my productivity be like 👁️ 👁️ 👄
@WilliamAlexandersProfile
@WilliamAlexandersProfile 4 месяца назад
They fixed navigation. Joy
@ntikomathaba2662
@ntikomathaba2662 3 месяца назад
Is this the best navigation for Compose Multiplatform?
@alexmercerind
@alexmercerind 4 месяца назад
Finally we got it!!
@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.
@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? 🤔
@deepaksingh-qd7xm
@deepaksingh-qd7xm 4 месяца назад
Now I will learn it I has paused my learning
@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?
@cfa532
@cfa532 Месяц назад
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.
@Dizzyslizzy
@Dizzyslizzy 28 дней назад
I used a json + simple kotlin class to get around this. shouldn't need to tho...
@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.
@kuromujou1346
@kuromujou1346 4 месяца назад
looking forward you make a video about this but with multiple nested graph. im newbie and im so confuse right now.
@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()
@mehdiparsaei1867
@mehdiparsaei1867 Месяц назад
Thanks! How about this code snippet? @Serializable sealed class Screens { data object Main : Screens() data class Settings(val username: String, val emailAddress: String) : Screens() }
@krasavec7088
@krasavec7088 Месяц назад
Is it possible to use that with nested graphs?
@deviantstudio
@deviantstudio 4 месяца назад
you asked why so long. i remember when Ian from the dev team said "you don't need to pass parcelables. just use strings in the URIs" 🤦 probably he has been fired already :)
@PhilippLackner
@PhilippLackner 4 месяца назад
And don't forget to serialize the strings :D
@kurtispalu
@kurtispalu 3 месяца назад
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
@ronalkspdev
@ronalkspdev Месяц назад
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?
@patsnow1066
@patsnow1066 4 месяца назад
Need this in KMM!
@ren7907
@ren7907 4 месяца назад
isn't that cool? YES it is f cool! Thanks Philipp
@carlosalvarado5331
@carlosalvarado5331 4 месяца назад
excellent just like SwiftUI!!
@rifatkhadafy9786
@rifatkhadafy9786 12 дней назад
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
@PhilippLackner
@PhilippLackner 12 дней назад
@@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
@helmutbierbaumer2648
@helmutbierbaumer2648 4 месяца назад
Highly appreciated 🥳
@DanielLuche
@DanielLuche 4 месяца назад
Nice. I'll be very usefull. Thanks to share bro
@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 3 месяца назад
Hi there, did you manage to fix it? It's happening to me also
@vsv8161
@vsv8161 3 месяца назад
Same problem
@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.
@sw_a_ppy
@sw_a_ppy 4 месяца назад
How to handle deeplink with latest navigation update
@billyflin
@billyflin 3 месяца назад
Why does not work with Double?
Далее
Navigation Compose meet Type Safety
16:50
Просмотров 11 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 77 тыс.
Front-end web development is changing, quickly
3:43
Просмотров 1,1 млн
How many kernel system calls do runtimes make?
19:18
Просмотров 19 тыс.
how Google writes gorgeous C++
7:40
Просмотров 886 тыс.