Navigation Component with Jetpack Compose
Вставка
- Опубліковано 30 вер 2024
- The BEST android courses in the world: codingwithmitc...
In this video I show you how to use Navigation Component with Jetpack Compose. It is very simple to use Navigation Component with Jetpack Compose. In fact, it's exactly the same. I recommend a single activity architecture with a fragment for each screen in your app. Each fragment should have it's own viewmodel. That kind of an architecture is perfect for Jetpack Compose and navigation component.
Code: github.com/mit...
Follow me:
Instagram: / codingwithmitch
Twitter: / mitch_tabian
.
.
Hey ENGAGEMENT this is your MITCH 😂
Mitch, Nice One again..
If I am dveloping an app from scratch then Is it a good practice to NOT to use fragment and do everything with compose UI?
can't wait for your complete videos of this jetpact compose with navigation component
Mitch I think Android team thinking about combine kotlin and flutter ------> Klutter. That's Jetpak very difficult to understand.
Klutter has a nice ring to it
bro you're a legend!
I'll leave a like in every single one of this videos, this course is pure GOLD!!
Love the improved video quality
Nice video
السلام عليكم هل يمكنك ان تساعدني لدي تطبيق نصوص قمت بانشاءه على منصة اندرويد استديو واستخدمت فيه (لست فيو) واضفت ملفات(html ) في فولدر ( الاست ) كيف يمكنني من اضافة خاصية استكمال القراءة من حيث وصل القارئ عند الخروج من التتطبيق والعودة اليه مرة اخرى .... علما ان التطبيق غير ربحي ... ولك كل الشكر والتقدير ...
You seem like a sweet guy Mitch. If someone were to be ENGAGED with you, they will be very lucky.
findNavController: Error No value passed for parameter 'viewId'
Not sure if API change or you lied in your video. 🙃
Just a suggestion, I am sure, you are aware of it, instead of using TextUnit.Companion.Sp() , we can directly use 21.sp, 42.sp as we are using the same for dp
Actually I did not lol
@@codingwithmitch happy to help :)
hi Mitch, last week I just learned about swiftui,, I think jetpack compose is looks similar to swiftui, isn't it? btw this is great video. thanks.
What about Jetpack Compose navigation (developer.android.com/jetpack/compose/navigation )? Isn't compose built to make the whole app in kotlin without XML? Does standard Navigation from a jetpack make it harder to make an app with Top and Bottom AppBar or NavDrawer? Now when You have separated views/fragments You have to add Top/Bottom AppBar to every main Compose in fragment. Or you can use it from standard navigation but I think it is not the best to mix Compose with View system. Also making many empty fragments that contain only `return ComposeView` looks a little weird to me.
Watch this ua-cam.com/video/Gi-MnWDRcmQ/v-deo.html
@@codingwithmitch That does not explain how to use it. I hoped for a video showing it off and explaining how to achieve the back button in the TopAppBar based on navigation state.
@@CommanderSteps If You want to have a back button/hamburger button in TopAppBar based on the app's current place in the Navigation graph You can look at my question and answer in SO. Probably not the best solution but it was the only way I found, maybe it helps You stackoverflow.com/questions/65079798/scaffold-with-topappbar-integration-with-navigation
Clicked the like button before watching
Thata boy
I really like your tutorial. Keep going
before watching this in 2022 i thought google messed up navigation in compose. maybe composables arent made for screens but only actual UI components.
Closed Blender, Now opening Android Studio
Engagement 4 months late, but still engagement. I think there is room for an update on this subject, I believe Fragments are not going to be used anymore only composables 👀. Thank you, Mitch!
Probably for new projects but if you have an existing app, interoperability is huge
Thank you so much CodingWithMitch. This tutorial helped me a lot more than Google doc.
why you are using XML for containing fragments. what's the point of jetpack compose if we have to use XML?
How is this simpler than regular fragments etc? I'm sick of android development being such a mess.
is there a solution that does not involve XML. like flutter.
Bro you prefect what I saw
Hi
How to give our own drawable instead of default icons in Jetpack compose(Icons.default.home),
Can you please help on this,
Please find below code for your reference
sealed class BottomNavigationScreens(val route: String, val resourceId: String, val icon: ImageVector) {
object Frankendroid : BottomNavigationScreens("Home", "Home",
Icons.Default.Home)
object Pumpkin : BottomNavigationScreens("Records", "Records",
Icons.Default.AccountBox)
// object Ghost : BottomNavigationScreens("Ghost", "ghost_screen_route", Icons.Filled.Home)
object ScaryBag : BottomNavigationScreens("ScaryBag", "Accounts", Icons.Filled.Home)
}
Hey Mitch, you are the King.
Greetings from Bosnia...
i quite dont understand why you put up graphs instead of using startdestination.. if i have to use xml again in my app compose makes no sense at all imho
engangement thing
Thank you Mitch, is a very clear explanation!
How about this, implementation 'androidx.navigation:navigation-compose:2.4.0-alpha04'? I try to use that, but I get an internal error. A bad one.
Are you gonna do a video on the navigation compose api?
Big fan bro🤩
Engagement for algorithm. Learning to get a job to buy your course.
TIP:
PS, on your website, if you saw a video, it show green checkmark. When you re-watch some part of vid., GREEN CHECMARK IS LOST, would be nice if checkmark would stay either way. Thumbs up !!!
Building a new engagement process..
This is really engaging, and I like how you keep it so simple as it get complicated!
is it only me or I need to declare my fragments abstract or I get an error
only you
use
implementation 'androidx.fragment:fragment-ktx:1.3.0-beta02'
- Mitch ENGAGEMENT!
- ENGAGEMENT Mitch!🤝🤝
THIS VIDEO WAS REALLY ENGAGING MITCH
Mitch, I found a new way to pass data between fragments if I am not wrong or I would say I found a new ways of roaming between fragments using Single Activity Architecture....
🐐🐐🐐🐐
WOW perfect -> thanks mitch
You are Android teacher, English teacher, Actor, Director, Composer, Artist, ...
Hey Mitch this is your engagement
I am enjoying your videos))
ThANks for giving it for free
Mitch good work I really love you man for making our android developer's life.
is there any bug in android studio canary 4.2? cause whenever i make changes in jetpack compose app i need to uninstall the app and then have to install it again in order to see changes. I'm not able to see changes after running app or instant run feature.
Loving the course :D
I have to finish Jetpack Compose for 2 days, and your videos help a lot)))
I love the way you explain.
thank you
Heyy Mitch, ENGAGEMENT
I followed you back when I was doing Pluralsight and I heard to follow you since then and never regret
Enjoying this alot!
Clear understanding
here is your engagement
I prefer to give the IDs to actions as to{destinationFragmentName} with example being toRecipeFragment. This allows us to write RecipeListFragmentDirections.toRecipeFragment() if safe-args is enabled.
safeArgs made my daemon process break somehow so I don't use it
Thank you Mitch
IT WAS ENGAGING MAN :))))
This is really engaging, and I like how you keep it so simple as it get complicated! 👌👌👌
HEY MITCH THANKS
Thank you for this nice tutorial. Even you speak fluently, it's understandable for non native english audience. Registered on your site and cliekd like on all video i'm watching.
Past couple days I watched some SwiftUI tuts and I think even with Jetpack Compose the Android Development is still hard compare to iOS. thoughts ? I am thinking to switch to iOS but Not sure if I will have a job opportunity with knowing the SwifUI only.
I think android is getting easier and easier. Soon it looks like we can get rid of viewmodels even. I'll talk more about that in my new course with kmm.
Ya I agree with only swiftui knowledge I'm guessing it would be tough to get a job. Just like if you only had compose knowledge it would be difficult to get a job.
For those experiencing crashing of app when using latest tools and dependencies, you may want to add this (compose-theme-adapter) in dependencies:
implementation "com.google.android.material:compose-theme-adapter:$compose_version"
engaging video
thanks mitch
Awesome!
Great!
Thanks!
Why on earth would anybody dislike any of these videos?
Video is kind of unrelatable in playlist or i guess video number 4 is missing from playlist. It directly jump from compose thing to xml
Oh shit you're right video 4 is missing from playlist. I will fix tomo
But what is the diferent between Navigation Fragment and NavHost?
I'm all out! just the video was great. as always :))
Hey Mitch, here's your composable engagement, great tutorial though.
mich whenever i create a fragment this error always pop Class 'RecipeFragment' is not abstract and does not implement abstract base class member
same here, help please
This video is so NOT UNengaging :p
Don't lie
i really like your teaching style bro , its really engaging
Hiya, how do you pass arguments to the other fragment via the example navigation? Thanks
Use a bundle. The .navigate function accepts a second argument as bundle
I m using navigation component in my project. It is basically a one activity (launcher) and many fragments to navigate in it. But I have to use bottom navigation activity also in this project. So if I use another activity in between how can we traverse or is there any solution?
Use bottom navigation in a fragment or hide/show it in the activity depending on what fragments you are visiting
Thank you for creating real value for me!
The best video quality. Good luck
Being in beta it still has many bugs is what i came to know so far, heating issues and resource management making the computer slow. Mitch, when can we expect a stable version outside canary build, any idea?
No idea. Seems to work great for me other than the @Preview feature.
You have engaged my interest... 🙂
We needed this tutorial.THANKS!
Awesome tutorial Mitch!
So, we are forced to have at least one xml layout file for hosting navigation graph?
nope if you use the DSL :)
🙌
Great video as usual. thanks a lot!
🙂
Loved your tutorials.
So the XML still lives.
Awesome vid man. Simple and clean
Thanks. Engagement!
Awesome Mitch!
Nice Video.
Which one is more sexy for you: Flutter or Jetpack compose?)
Flutter
Leveling up in Compose is fun 😊
Engagement!!
Great effort bro. Keep it up.
nice~
I LOVE YOU SO MUCH MITCH... JUST I CAN SAY "I LOVE YOU"...