This library is amazing, but what's even more amazing is what Rafael used to create it. Kotlin Symbol Processing or KSP is "an API that you can use to develop lightweight compiler plugins. KSP provides a simplified compiler plugin API that leverages the power of Kotlin while keeping the learning curve at a minimum. Compared to kapt, annotation processors that use KSP can run up to 2 times faster. Also, because KSP traces symbol resolutions dynamically, a change in a file is less likely to pollute other files and therefore the set of files to be reprocessed is smaller (that's why it's faster). This is not possible for kapt because it delegates processing to javac. KSP can process Java sources as well. The API is unified, meaning that when you parse a Java class and a Kotlin class you get a unified data structure in KSP." So when you mark your composables with @Destination just know that is the power of KSP not kapt.
@skullkrum203 жыл бұрын
Completely agree! In fact, some of my features would not be possible with Kapt, at least not without some workarounds :)
@jonneymendoza Жыл бұрын
NICE, please explain this in more depth
@FlorianWalther3 жыл бұрын
Nice, I actually used his approach in my live streams (without the library tho) Thanks again to Rafael for his help!
@skullkrum203 жыл бұрын
No problem Florian, it was my pleasure! :)
@AmitJayant2 жыл бұрын
@@skullkrum20 Thank you for this library
@ubersticks3 жыл бұрын
Thanks for sharing this Philip! I watched your videos using Compose navigation and was disappointed how ugly Navigation had become. It was a step backwards. You didn't make fun of it in the videos, so I thought it was just me. :-) This is beautiful (thanks @Rafael Costa)
@pierre.vieira3 жыл бұрын
Finally something like this has been released, thanks for sharing!
@JohnDoe-wx3zm3 жыл бұрын
Thank you Philipp for making this video, and thank you YT algorithm for recommending it to me! At least that's one thing Google did correctly...
@PhilippLackner3 жыл бұрын
Glad it was helpful!
@jaidynbelbin48633 жыл бұрын
This looks amazing! Not being able to pass an actual object through the route was such a strange thing to discover coming from SwiftUI and Flutter. Will you migrate to this in your Android Twitch Network series?
@PhilippLackner3 жыл бұрын
In case you missed my recent updates regarding that on Instagram - there will be no further streams on Twitch for the 2 main reasons: 1. All the functionality of the social network app that we wanted is done 2. It's extremely difficult to learn, concentrate on coding and entertain an audience who watches your stream. If any of these points lacks this immediately results in a significantly lower number of people who watch the stream. That demotivates over time. So in short, I don't enjoy it anymore and think it's more win-win if I instead make youtube videos which reach more people and at the same time are a lot more fun for me.
@nithinraj073 жыл бұрын
Amongst the few members who is a follower of your SocialApp project, it helped me a lot in building huge app and I used to constantly go back to the project repo and learn how you have implemented a certain thing. Usually the projects that are available in docs to refer to are either too old or non intuitive It’s sad that you are discontinuing the series. But anyways, looking forward for more content !
@PhilippLackner3 жыл бұрын
@@nithinraj07 glad you enjoyed it and thanks for watching!
@jatinvashisht42933 жыл бұрын
Yeah not able to pass parcelables were such a pain
@pratikchauhan81753 жыл бұрын
What a great library makes the work easier and cleaner Thanks 👏
@shahidzbi2 жыл бұрын
Damn Man Rafael u r an angel What a solution ❣
@vedx3 жыл бұрын
Awesome library. I have been using this. 👌🏻
@vengateshm21223 жыл бұрын
Thanks Phillip for sharing.
@flowzk9213 жыл бұрын
wow this is super cool, now one can pass actual objects!
@brianryan40533 жыл бұрын
Rafael is genius.
@zafar_codes3 жыл бұрын
Great, thanks 🔥🔥🔥
@garrisonsnow77762 жыл бұрын
Do you use still use this library in your projects? It's been a year now just wondering
@valtteri_its_james Жыл бұрын
Maaan, this library is legendary !!!
@arfinhosain3 жыл бұрын
finally you changed the theme
@mustafaammar5513 жыл бұрын
very cool library thank you
@tigranavdalyan900 Жыл бұрын
how to implement nested navigation graphs in this library?
@sovrinfo3 жыл бұрын
Thank you a lot!
@Ryan-ff2db2 жыл бұрын
This is the second most awesome thing I've ever seen.
@skullkrum202 жыл бұрын
Thanks Ryan 🙂
@Ryan-ff2db2 жыл бұрын
@@skullkrum20 Thank You.
@xavierrispal96053 жыл бұрын
Awesome !! Could be nice to check how this library can work along with accompanist-navigation-animation :-D
@skullkrum203 жыл бұрын
It already works! You can check more details in the Readme and wikis 😁
@siddheshpalkar3986 Жыл бұрын
Please let me know if you find a way to add a transition in this library..
@siddheshpalkar3986 Жыл бұрын
@@skullkrum20 Please let me know if you find a way to add a transition in this library..
@skullkrum20 Жыл бұрын
@@siddheshpalkar3986 it’s already done!
@thegreatwarrior49893 жыл бұрын
You made my day ✊✊✊👍👍👍
@rma15632 жыл бұрын
It does not identify "NavGraphs.root" in "DestinationsNavHost(navGraph = NavGraphs.root)" anymore. Any help please?
@eslamhamdi57123 жыл бұрын
👏 Amazing, you are a life saver
@PhilippLackner3 жыл бұрын
Happy to help!
@techmarinar2 жыл бұрын
Thank you very much , but we need you to make a video of Bottom Bar navigation with this awesome library (raamcosta )
@safionweb2 жыл бұрын
Hey, Philipp! Thanks for this amazing video. Has Google come up with a better solution as of yet? Or should we use this 3rd library?
@skullkrum202 жыл бұрын
No new solution from Google as of now. 🙂
@Warrynt3 жыл бұрын
omg thank you so much
@PhilippLackner3 жыл бұрын
Happy to help
@abada-s3 жыл бұрын
Wooow this is amazing
@moheltanani10362 жыл бұрын
What an amazing library. I love it, I just have one concern. So, I was told before by boos not to use third party library for our app (which is a release app published on store) because incase one day support stops for such library then our app will not be functional anymore. So, what are your thoughts about this subject using this library? Like, is the library dependable enough to use in released apps? or I should stick with native compose? Your replies are much appreciated!
@jonneymendoza Жыл бұрын
Swhat if the originl author abandons it? doesnt meanan that the library is deleted off your project all of a sudden
@firstnamelastname-oy7es Жыл бұрын
@@jonneymendoza If the dev stops active support for this library, then In the future, after a bunch of android and google updates, the library might not work anymore because files and other things in the OS are moved into different places and functions may get renamed or deprecated in other ways. Also the original author of the third party library may pull the code offline one day, or may be forced to if they used code in their library form another library that they didn't have the rights to. It could also be a security issue if you don't go over the whole source code of the third party library before using it, and every time there is an update to the library. It can get complicated fast. If all the code is your own, then you don't have to worry about those issues. If the boss says not to use it, then I guess you have to do what the boss says. It sucks but what can you do? If the boss finds out the app doesn't work correctly or has security issues in the future because an employee did something the boss said explicitly not to do, it might cost that employee their job.
@jonneymendoza Жыл бұрын
@@firstnamelastname-oy7es even Google abandons there libraries
@Theotoffel12 жыл бұрын
one beginner question still is open to me: How can i pass a viewmodel to share it with all composables in this navgraph. passing it as parameter doesn't work
@skullkrum202 жыл бұрын
Check documentation website and search “share ViewModels”. It will get you there 🙂
@Theotoffel12 жыл бұрын
@@skullkrum20 thanks for answer, i will try to make it. For me as beginnen it's Not quote easy to understand. May be because of Lack of knowledge
@eugenewainaina56269 ай бұрын
Chris P Bacon, lol. The lil pig. W reference
@serhiiostrovskyi43872 жыл бұрын
Looks great, however what if I want to share a viewModel between destinations?
@xectrone Жыл бұрын
Same question did you find any solution?
@jatinvashisht42933 жыл бұрын
Can we still get navigation arguments from saveStateHandle in view model like in compose navigation?
@skullkrum203 жыл бұрын
Yes Also in a type-safe way! val myArgs = MyScreenDestination.argsFrom(savedStateHandle)
@jatinvashisht42933 жыл бұрын
@@skullkrum20 wow, that's really nice, thanks for the library 🙏
@KotlinBek2 жыл бұрын
that would be awesome if you talk a bit more about back Stack. yeah great video btw
@ChrisAthanas3 жыл бұрын
Incredible
@yousefbeiruty64172 жыл бұрын
How could I implement a navigation drawer or bottom navigation using this library 🤔
@amineayachi3352 жыл бұрын
thanks so much
@gauravkumar-bs3pf Жыл бұрын
I am unable to generate the classes after rebuilding the project. how can I resolve this problem?
@tanaygupta69053 жыл бұрын
Hey, can you tell which theme you are using? 🤩
@PhilippLackner3 жыл бұрын
Xcode theme
@Siva-vn1wo2 жыл бұрын
can we use this in bottom navigation?
@denisk38522 жыл бұрын
How about animations between screens? Thank you!
@skullkrum202 жыл бұрын
Look in the documentation website under “styles and animations” > “animated style”. Don’t forget the setup section below that as well.
@BuildItCreative Жыл бұрын
Why not use this library in newest video..?
@siddheshpalkar3986 Жыл бұрын
Could you please make a video on how we can add the transition to this library?
@tcl782 жыл бұрын
I'm not really a fan of using 3rd party, unofficial libraries in my projects... especially libraries that have their roots so deep into the system. I don't want to find myself in perhaps 5 years or more having to rip apart the whole app because i cannot compile it anymore since an unofficial 3rd party library is being deprecated or doesn't behave correctly with future versions of Android or the official libraries that i already use. This of course has nothing to do with this specific library, but in general. The less you rely on 3rd party libraries, the less bad surprises you are going to have in the future. I really don't want to find myself rethinking and rewriting the navigation of an app i wrote years ago only because i did a bad choice... it is already hard enough to have to work with something YOU wrote years and years ago without even remembering what it was about, how it worked, etc. because your user asked for a new feature in an existing app you build... i don't really want to make this process even more difficult by "betting" that the libraries i used will still exist in a few years from now. So, even if it is painful, I'll stick with the official navigation recommendations from Google and wait for them to come up with an official (and fully supported) solution... and i'm already pissed by the fact that they keep changing how to develop androids apps apparently every few months forcing me to re-learn how to do things i thought were settled over and over again...
@skullkrum202 жыл бұрын
It’s the beauty of our field if you ask me. Things keep evolving and changing and every time there is some detail which is slightly better or easier. It’s also a lot of fun to learn things if you ask me 😉 I understand the fear of libraries. That’s ok, it’s not for everybody. That said, consider this: this will not change the core of your navigation. It is a wrapper to the official APIs. You should be able to easily go to official way if you need to since at the core it’s all the same. Also, I’m never going to stop providing support and updates unless Google comes up with this exact type of solution (and only if it is objectively better in all ways) at which point I would provide a migration path which as I said should really be very easy to follow. So it’s up to you to decide if this potential future migration cost is likely enough or hard enough that you’d rather pay an upfront cost of having to deal with navigation as it is without the library. But I can tell you for sure that the answer is not always yes and it is not always no. It will depend on a lot of factors related with your project setting how good are the developers to do these easy migrations, how big is the project etc etc.
@gadeern15862 жыл бұрын
Thank you for the amazing video!! could you please do a video about how to use this navigation library with a top app bar (with dynamic titles and icons) 😢
@skullkrum202 жыл бұрын
Very similarly to how you can do it in normal compose navigation 🙂 You should use a Top level Scaffold wrapping the DestinationsNavHost. Then call currentAppDestinationAsState and change toolbar when destination changes 🙂
@tonnie70792 жыл бұрын
Hi Philipp, Have followed the lecture but I am wondering if you use Compose Destinations, where does that leave the theme?Since you have moved the screen composables out of the Main Activity, how then do you theme the app?
@skullkrum202 жыл бұрын
That is not different than without the library 🤔 You still have the Theme in the same place (just like he has on the video). All screens will still be themed with it!
@tonnie70792 жыл бұрын
@@skullkrum20 Thx for clarifying
@Rafael-hk9pg3 жыл бұрын
Great video! How can you implement a conditional startdestination?
@skullkrum203 жыл бұрын
Hi Rafael! Great name btw :D You can pass a start destination when calling DestinationsNavHost, just as you could do before.
@Rafael-hk9pg3 жыл бұрын
@@skullkrum20 haha thanks!
@marekmisik72783 жыл бұрын
great, but could you make a bluetooth example with compose by any chance?
@KingFuYouTube3 жыл бұрын
How would this library work with bottom navigation and can it prevent 1 screen from stacking up if reselected repeatedly?
@skullkrum203 жыл бұрын
It would work the same way as with normal compose navigation. To prevent screens from stacking up, you need to use launchSingleTop when navigating :)
@KingFuYouTube3 жыл бұрын
@@skullkrum20 Thanks for replying I will test it out.👍
@skullkrum203 жыл бұрын
@@KingFuKZbin Let me know how it goes!
@manuelduarte88803 жыл бұрын
what is the name of the theme you use in the IDE
@obewan-kenobi Жыл бұрын
Is that library can support nested navigation?
@sinandinc86073 жыл бұрын
hey philip thanks for video also could you make a video about to modular architecture
@PhilippLackner3 жыл бұрын
I'm working on a big course that will come out this month
@sinandinc86073 жыл бұрын
@@PhilippLackner oh thanks ı'm so glad to hear
@venkatesh43073 жыл бұрын
Super cool
@allanandliftedhands26693 жыл бұрын
I love this..my only confusion is wether i should start learning and using this right away..or perfect the previous way first..is it advisable to learn the previous way first or i should jump right into this..? Any help is appreciated.
@PhilippLackner3 жыл бұрын
IMO you should understand how Compose navigation works generally. But once you feel comfortable with the basics, feel free to use this
@allanandliftedhands26693 жыл бұрын
@@PhilippLackner thanks a lot that really has helped.
@skullkrum203 жыл бұрын
This is basically the same thing if you asked "Should I learn manual dependency injection before using Hilt/Dagger?". The answer is, you should at least understand what Dependenc injection is and have a general idea of how you would implement it manually. So yeah, like @Philipp said, try to understand the basics, then don't worry if you don't understand EVERYTHNG :)
@luckydevil16012 жыл бұрын
Does it affect performance negatively? If not, then it's incredible!
@PhilippLackner2 жыл бұрын
Nah, it uses the normal navigation, but just exposes functionality that's easier for us to deal with
@sjavokhir3 жыл бұрын
Why doesn't "Join" button appear on my KZbin app?
@asrieltiago3 жыл бұрын
Thanks for sharing this amazing library! Btw, can you make a video about how to handle specific top bars for two or more screens? I'm working in something like these, but i was confusing about having only one Scafold on the MainScreen, that handle the top bars using callbacks, and observing the current screen state. Or the best way is to have a Scafold on every Screen? Example: 1. First screen top bar has a search icon, that can filter something. 2. Second screen has a back button, search icon disappears. 3. Third Screen has a menu button, back button disappears. Maybe this library can already help with that... Another thing, is how to implement a Scrollbar on a LazyColumn.
@azuolassaulius9383 жыл бұрын
Epic. But can i use this library if I'm developing app where i don't want the code to be open source?
@skullkrum203 жыл бұрын
Of course! It's just like any other library. You get the dependency from maven central and that's it. Don't need to worry about that :)
@swiffty12 жыл бұрын
How do you pass in a DestinationsNavigator for use in a composable. E.G MainActivity contains a composable and I want to ass in an implementation of DestinationsNavigator to it
@skullkrum202 жыл бұрын
I'm not sure I understand your use case. If you're talking about navigation that happens out side any specific screen, you should use NavController. DestinationsNavigator is only meant to navigate from screen to screen.
@swiffty12 жыл бұрын
@@skullkrum20 Do you mean use the native android NavController not connected to your compose-destinations library? Yes I mean if I wanted to control navigation from MainActivity for example e.g only use NavHostController in MainActivity rather than have the screens control navigation themselves.
@skullkrum202 жыл бұрын
@@swiffty1 NavController is connected to my library. It is what I used internally inside DestinationsNavigator. You can and should do rememberNavController() and pass the result to DestinationsNavHost. Then you can use navController.navigateTo extension function and your set 🙂
@jehandadkamal9637 Жыл бұрын
How can we override Deeplinks?
@edwardbaylon47293 жыл бұрын
How do you pass parameter to the starting composable?
@PhilippLackner3 жыл бұрын
I can't think of a case where you would want to do that / couldn't do that in a better way
@skullkrum203 жыл бұрын
You cannot do that even with official compose navigation. Start destinations cannot have mandatory navigation arguments 🙂 Which makes perfect sense btw.
@xectrone Жыл бұрын
@@skullkrum20 shared viewModel
@asadullahilyas2 жыл бұрын
How can we implement this with Bottom Navigation Bar? I tried something but as soon as I press a button in Bottom Navigation Bar, whole screen, including the Bottom Navigation Bar, is changed to new destination.
@skullkrum202 жыл бұрын
It’s really not that different than with official compose navigation. You can check the documentation website and search for it, you’ll easily find the example 🙂
@saeedsharif2463 Жыл бұрын
sir hwo we use this with bottom navigation
@DerCheckerzeigts3 жыл бұрын
How would this work with firebase-dynamic links and dynamic routing?
@skullkrum203 жыл бұрын
How did you solve that with "normal" compose navigation component? Is it through Deep Link? If so, then you can specify deep links in your screens via the annotation, like @Destination(deepLinks = ........)
@DerCheckerzeigts3 жыл бұрын
@@skullkrum20 I dont know the compose way, but with xml its achievend via deeplinks. So yeah, your approach should work aswell. Thank you!
@skullkrum203 жыл бұрын
@@DerCheckerzeigts Ok, I wanted to make sure :) Then yeah, this library will be easy to setup for that and actually it will be easier than with xml to work with Deep links in general.
@kingcoder76543 жыл бұрын
Amazing
@EverythingWithKotlin3 жыл бұрын
hello there .. your tuts are amazing .. can i request to make a full jpc apps with multi modular please ?
@sacarymoviesamu2 жыл бұрын
It's so cool. I like simple things because i'm stupid when programming. Brain go DUUUUUUHHHHHHHH
@muhammadtalhaakbar8262 жыл бұрын
How to give viewModel as argument to root screen. I have a screen which contains navDrawer and I want to navigate to other screens inside the content of navDrawer.
@skullkrum202 жыл бұрын
Hey 👋 The nav drawer is not part of any screen. It is part of Scaffold that you use on top level Composable. To navigate in that top level composable, you take the NavController you pass to DestinationsNavHost and use the navController.navigate(Direction) extension function. Also, the top level Composable that contains the Scaffold is not related to Compose Destinations since it is not a Destination (you don’t annotate it with it). So you access viewModel directly through the methods available like “viewModel” or “hiltViewModel” or whatever way you usually get view models 😅
@Theotoffel12 жыл бұрын
03:32 the start ist very interesting
@visvajeet56093 жыл бұрын
Is there any performance issue?
@skullkrum203 жыл бұрын
No. This is all code generation that happens at build time. Other than that, it is code that you could have written yourself, so no performance penalty.
@visvajeet56093 жыл бұрын
@@skullkrum20 cool
@hamuelagulto7962 жыл бұрын
Isn't Google going to fix compose navigation?
@skullkrum202 жыл бұрын
There is nothing to fix. This is only a matter of usability and its probably somewhat discussable. So, if your question is "are they going to improve usability?", my answer is "I don't think so".
@hamuelagulto7962 жыл бұрын
@@skullkrum20 that's unfortunate
@RadhakrishnanNaik2 жыл бұрын
any idea, how to pass `arguments: List` and `deepLinks: List` to the navhost composable with this library
@skullkrum202 жыл бұрын
The whole idea is: you don’t need to. 🙂 NavArguments get inferred from the annotated composable arguments and you use a parameter on Destination annotation to define your deep links. Check the repo, it has link to documentation
@RadhakrishnanNaik2 жыл бұрын
@@skullkrum20 Thank you
@gauravthakkar8023 жыл бұрын
Please share your theme
@Danuel3 жыл бұрын
Xcode dark theme
@mxkmn2 жыл бұрын
Just now tried unsuccessfully to add navigation with this library. It looks like a load of crap. The documentation doesn't work. Samples from github won't run because of wrong configurations. Half of the features are already "deprecated". Wasted 3 hours of my time.
@skullkrum202 жыл бұрын
Hey @mxkmn ! Are you sure you followed all steps in configuration? Also, samples from the library project GitHub are guaranteed to work always. What GitHub did you get wrong samples from? We have literally zero deprecated features 😅 What we have is some small APIs that were replaced with better versions of themselves. This is how a library evolves without making breaking changes, you know? 🙂 Please hit me up on Twitter DM or open an issue on GitHub with the problems you’re facing. I’d be glad to help 🙂
@deviantstudio2 жыл бұрын
same thoughs when i tried original google navigation. what a waste of time... but this lib looks very promising. probably most well architected, based on what i saw in the docs. so @mxkmn you should reconsider if you chose a profession right ;)
@mxkmn2 жыл бұрын
@@deviantstudio I wrote this comment amidst an imminent deadline for those who are also considering this library in order to not have to deal with the complexities of a standard implementation. The problem is that I was able to run everything without additional libraries, while the library from the video didn't work by copying and provided incomprehensible documentation. This library could be a lifesaver for a large project, but in a small project (like my course work) it's not hard to do everything without it. In fact, I would like to try this library again when I need it. I'll be sure to add new thoughts to my comment afterwards. Programming has been my hobby for five years, but I'm new to Android. However, I will definitely consider a career change xd
@longshin42992 жыл бұрын
Thanks for your video. But I got an issue with ProfileScreenDestination. It's does have user params
@skullkrum202 жыл бұрын
Hi Long shin. Can you please open an issue on GitHub with more details? Or send me a DM on twitter. I’d love to help out. It’s probably something missing on your side, but I would need more details 🙂
@longshin42992 жыл бұрын
@@skullkrum20 it's about passing scaffoldState. But hopefully I found the your docs. And It's done. But it's take some time to find that
@longshin42992 жыл бұрын
@@skullkrum20 Could you add some usage about that in readme for orthers developer to find it quickly?
@skullkrum202 жыл бұрын
@@longshin4299 cool. Yes I am trying my best to improve docs but it’s still a long ways to go!
@skullkrum202 жыл бұрын
@@longshin4299 I really want to keep the readme lean. Everything that is not about basic usage should be only in the documentation website.
@emmanuelmtali15942 жыл бұрын
What you have conditional navigation i.e. if logged in home is profile if not login is home
@skullkrum202 жыл бұрын
DestinationsNavHost has a startRoute parameter where you can pass the start you want at runtime.
@zakmiltan2 жыл бұрын
Hi Philip Have you ever manage to do a mix match with the conventional google navhost or with this KSP one , to have a bottonsheet modal support , without crashing the app due to 2 different navhost has different startDestination, I get like an error like this"ViewModelStore should be set before setGraph call"
@zakmiltan2 жыл бұрын
Answer to my question id does I've just done a test project , This library should be in the official google package, this not just simple but has a full support to have a bottomsheet navigation without changing the navhost root and it wont crash , thanks Rafael for this amazing enhancement.
@sublimecoder Жыл бұрын
You need to use different navcontroller object for different navhost 😅
@jakhongirmadaminov58493 жыл бұрын
I cannot make it work in a multi module project
@skullkrum202 жыл бұрын
I am working on a fork of a known Chris Banes project: tivi. In the next few days, I'll be doing a few small changes on Compose Destinations Library to be easier to use in multi-module projects (you can already do it, but I want to try to make it easy). Later I'll make my fork public so everyone can see an example of a multi-module project in practice 🙂 So don't give up on this library yet!
@FreedivingTrainer2 жыл бұрын
NavGraphs not found (app builded). But app bulded and I see generated class UPD: Downgrade gradle plugin to 7.3.0 do the trick. (AS use 8.0.0-alpha for new projects by default)
@rma15632 жыл бұрын
I have downloaded his project as it is and changed the gradle plugin to 7.3.0 as you have said and it still doesnt work. " unresolved reference : NavGraphs.root ". Any help?
@tiltedbybox61182 жыл бұрын
Is conditional start destination possible? For example Non auth. user - after splashscreen immediately goes into login/register destination Authenticated user - splashscreen stays visible while data is being fetched and then user is redirected to Home destination. It was a bit tricky for me to get this working with xml nav component and the splashscreen api, but at the end it turned out quite good. So I'm wondering if I can easily migrate this part to compose.
@skullkrum202 жыл бұрын
Yes, you can use override the start destination on the annotations at runtime when you call DestinationsNavHost.
@xephosbot Жыл бұрын
I am now faced with this. Did you find any solution? I'm trying to check on the Login screen if the user is logged in and go to the main screen. But it still causes a little flash
@LEEJIHUN Жыл бұрын
updated version need
@visvajeet56093 жыл бұрын
How to use it with BottomNavigation? How to read currentBackStackEntryAsState()
@skullkrum203 жыл бұрын
Same way you do it without this library. You get the navController, pass it to the DestinationsNavHost, and you are free to do anything like before :) The cool part with that is that you can easily get the generated Destination correspondent to the current nav back stack entry too. So you don't need to be comparing routes. You instead compare type-safe constructs like these Destinations.
@ahmedrabie44912 жыл бұрын
SOrry to say that but the liberary seems to be not working at all, I belive they changed it a lot without adding new dopcumentation or its stop working anyway
@PhilippLackner2 жыл бұрын
It works perfectly fine for me, also for the latest kotlin version
@skullkrum202 жыл бұрын
Yea absolutely it is working, tons of teams are using it 😊 It also has a docs website that is up to date 🙂
@mariush8733 жыл бұрын
Library looks cool but, I am not sure if passing a whole parcelable object is the best way. I think what we should do is to pass only userId and then on the next screen use a room database to get user by this specific id. What do you think? :D
@skullkrum203 жыл бұрын
Definitely for this use case, User is most likely something you want to store somewhere in your database and just pass ids around. But there are situations where that is not very practical and a small Parcelable class is a better way to do it. After all we have always had that possibility, so I just added this support to let developers choose for themselves :) But you don't need to use Parcelable to justify this library. It will make your life much easier and the code much cleaner and safer!
@deviantstudio2 жыл бұрын
oh yes! room database is the most suitable tool for passing few primitives from screen to screen (sarcasm). i think google should deprecate whole lib and start it from scratch. the current one was a mistake.
@emmanuelmtera59363 жыл бұрын
I love your native android videos and i really enjoy them , But i was wondering how powerfull kotlin and compose can be so, Can you make a compose app, that tracks (or prevents a phone from being flashed if it is stolen,lost e.t.c)
@crateer2 жыл бұрын
Weird question. But no, you can’t write any user app which does that. Basically impossible. (Before you ask, this has nothing to do with kotlin or compose btw.)
@loiseaulucien43732 жыл бұрын
Great video! can you make a follow up video with deeplinks using this library ?
@John-qt6qk3 жыл бұрын
Gr8
@coocys21433 жыл бұрын
Hey :D This is not about this Topic. More an Video Request. Can you maby do an Tutorial for an Language switcher in the App for all Text Elements. That would be so awsome :D And a Question about this Library. Is it possible that Google will Implement this in Compose themself?
@skullkrum203 жыл бұрын
> And a Question about this Library. Is it possible that Google will Implement this in Compose themself? It is possible, but at the moment it doesn't seem likely.
@bro_chenzox Жыл бұрын
🏅
@alexandrereutola32462 жыл бұрын
What parameter should I use for a screen preview since I have to specify a navigator as argument?
@skullkrum202 жыл бұрын
EmptyDestinationsNavigator
@alexandrereutola32462 жыл бұрын
@@skullkrum20 Thank you very much!
@samirbasnet95233 жыл бұрын
Can anyone tell me while using this library is it possible to pass data back to previous screen when navigating back? If yes how?
@skullkrum203 жыл бұрын
It is possible, but it will be just like using normal compose navigation. You have to use navBackStackEntry and put your values there by key. So basically, this library did not do anything in regards to that: all tools available for that are still there, but there are no special help to do that in a safer way. Yet anyway, who knows! :)
@samirbasnet95233 жыл бұрын
@@skullkrum20 Thank you for confirming but i still cannot figure out how to do it. Could you possibly guide me with a bit of example code?
@@skullkrum20 Thanks a lot . Also i found that we can pass parceleable object into composables directly from parameter but if we use @Destination(navArgs=..) it gives error saying 'navArgsDelegate' cannot have arguments that are not navigation types
@skullkrum203 жыл бұрын
@@samirbasnet9523 Really? I will jump right on it :D Do you mind opening an issue on the github repo?
@MatthewSmith-mt3kz2 жыл бұрын
The library looks simple enough to use, however, I was having some issues combing KSP (for the library) and KAPT (for Dagger Hilt - no KSP support yet) in my project. Just couldn't seem to get the two to play nice together. Order of the plugins made no difference. Otherwise, the library seems to be what we need until the Compose navigation evolves (even if it's just parcelables).
@skullkrum202 жыл бұрын
That’s weird, I’ve had both hilt and compose destinations at the same time before. There are no reports that I known of of these two not getting along 🤔
@MatthewSmith-mt3kz2 жыл бұрын
Finally got it working, was mainly incompatibility issues within my project (Kotlin/Gradle/Hilt/Room etc). Anyway, great library, super simple to use. Will admit though haven't converted any of my Dto's to parcelables (yet?), so not passing complex objects (or even lists of those objects, not sure if that's the right way), more just query parameters, key/value pairs etc. Thanks Rafael.
@skullkrum202 жыл бұрын
@@MatthewSmith-mt3kz Definitely! Do not pass big structures as navigation arguments. The capability is there in case you need to pass small Parcelables around 🙂 Btw, it’s not widely known but even with official compose navigation, you can pass parcelables as nav args. There is even an example of it in Kotlin dsl navigation docs. So all this lib does is making it much easier to do it if you need to 🙂
@fensom802 жыл бұрын
Crispy bacon mmmmmm....
@hussien_fahmy2 жыл бұрын
Actually I didn't like it, yes it's a great work, BUT there is no way to summarize or to see the overview navGraph, no way to specify the routes, any destination can accessed any other destination, in projects with +5 screens it will very hard to maintain that if you passed your navigator everywhere
@skullkrum202 жыл бұрын
> there is no way to summarize or to see the overview navGraph, You can just open the generated NavGraphs object, its way better to overview your Nav graphs than official compose navigation which you need to always look at all the routes, args, etc. > no way to specify the routes Yes, there is. You can set your route in the annotation. But anyway, the library will mostly abstract you from routes, you most of the times don't even need to think there are routes underneath. > any destination can accessed any other destination Don't know what you mean. In official compose navigation you can also access all screens from all screens, you just need their string routes. If you mean the way we navigate with DestinationsNavigator, you don't need to do it that way. You can still manually call your screens in the DestinationsNavHost last parameter and pass lambdas, just like you would with official compose navigation, except way clearner and type-safer! Would love to talk to you and show you just how great the library is :)
@hussien_fahmy2 жыл бұрын
Yes it's a great work, I didn't ignore that sir What I did not like is the way to use the library, when you use the official one you can use the nave Controller in one place So you can see an overview of all the app navigation structure. But with this library, if I have more than like 10 screens I will got lost! I will not able to see which destination navigates to specific destination because the navigator passed to every destination and I have to read all this code, or the generated nav Graph as you mentioned which I think it's not practical. The library is a great, I loved it especially when you develop a small app like 5 screens for example, But it really need to consider this feature, the way of navigator use need to be modified to be more like Google implementation as the nav Controller need to be in one place and not passed to any other composable, to be able to test your navigation logic and to see an overview of all destination however its not also the best overview in my opinion. Thanks for your time replying to me🤗
@skullkrum202 жыл бұрын
@@hussien_fahmy thank you for your kind words! I feel like you did not read the last part of my reply though 😄 Using a navigator on each screen or not is a choice you make when using Compose Destinations just as it is when you don’t. You can have all navigation logic in the DestinationsNavHost! Just don’t add the navigator in the parameters of the screen and call your screen in the DestinationsNavHost passing normal lambdas. Exactly like official way but much cleaner because you don’t need to deal with nav args and such in the same place. Also exactly why is it not practical to open the NavGraphs file? I cannot understand why 😁 To me its way more practical than having to infer navigation graphs between all the arguments code and such. Especially in complicated projects with tons of screens! You got it wrong, the official library is fine for apps with 5 screens but gets messy with complicated apps if you’re not really careful. With compose destinations its always going to be clean no matter how much screens and nav arguments you have 😉
@skullkrum202 жыл бұрын
And I haven't even told you the feature that definitely closes this arguments forever: There is support in Compose Destinations to let you still use the normal NavHost, call your screens and all that exactly the same way you do with official library but just way cleaner and type-safe. There are extensions on the NavGraphBuilder that let you pass a generated Destination and that's it, you get on the trailing lambda the nav args in a type-safe way and there is way less boilerplate and unsafe code you have to write :) You can check on the docs (that is in the github repo) and check "Navigation Host Composables" -> "Vanilla NavHosts" section!
@hussien_fahmy2 жыл бұрын
Wow that's very very great work, I should apologize for my first words. But really this ability and features should be in the readme file or mention to open the website link to know this usage. I wouldn't know it if I commented here and you replied to me @Rafael Costa you did a great work.. 😃😃
@carbaj033 жыл бұрын
if the parcelable featture isn't provide for the compose navigation library is because is a bad practice. Id's are your friends :)
@kinggeorges6253 жыл бұрын
I do hate ID's 🤨 which required to make extra API calls. In the past I have used instead the DB to cache data and collect it with the ID
@skullkrum203 жыл бұрын
And what about passing those ids in a type-safe manner? Is that a bad practice too? :D Btw compose navigation library supports passing Parcelable. It is supported, it just needs extra steps to set it up properly. You can check their docs on Kotlin DSL navigation - custom types section.
@tonnie70792 жыл бұрын
@@skullkrum20 Wow, you know your stuff man, I am impressed.
@deviantstudio2 жыл бұрын
you know what is a bad practice? tell other people that things they used to is a bad practice. i personally use parcelables as screen args for more than 10 years. and the only 'bad" thing i see here is that requirement of make it Parcelable. other ui frameworks allow you to pass any kind of data, not limited to parcelable/serializable.
@tonnie70792 жыл бұрын
@Destination(start = true) is deprecated instead use @RootNavGraph(start = true) together with @Destination