BottomNavigationView with Navigation Component - Android Studio Tutorial

  Рет қаралды 212,763

Stevdza-San

Stevdza-San

Күн бұрын

🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
stevdza-san.com
🐱‍👤 Wanna become a member? Join!
/ @stevdzasan
📸 Instagram
/ stevdza_san
Bottom Navigation View is a material component that makes it easy to explore and switch between the top-level destinations in single click or tap.The bar contents can be populated by specifying a menu resource file. Each menu item title, icon and enabled state will be used for displaying bottom navigation bar items.
** Compile Options **
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

Пікірлер: 327
@bryanmoreno626
@bryanmoreno626 4 жыл бұрын
Java code of 5:55 BottomNavigationView bottomNavigationView = findViewById(R.id.bottomNavigationView); NavController navController = Navigation.findNavController(this, R.id.fragment); NavigationUI.setupWithNavController(bottomNavigationView, navController);
@burakkaraduman3814
@burakkaraduman3814 4 жыл бұрын
I can't click the other icons with this code.
@henrylo4589
@henrylo4589 4 жыл бұрын
Thanks man, you really helped me with my project
@rittikdutta3675
@rittikdutta3675 3 жыл бұрын
Thanxs
@randomthings77
@randomthings77 3 жыл бұрын
Thank you man.. Life saver
@backwardzzzz
@backwardzzzz 3 жыл бұрын
Thanks, bro
@justaaq
@justaaq 4 жыл бұрын
Very professional . to the point , knows when to slow and when to speed . Followed the tutorial and was able to generate the needed UI . Thanks
@evelynediazaraque6095
@evelynediazaraque6095 3 жыл бұрын
Such an amazing, concise and straight up tutorial! You're a genius, thank you!
@brandondelacruz2933
@brandondelacruz2933 4 жыл бұрын
Holy shit, your content is Gold! I thought I was becoming stupid due to listening to those unclear tutorials, but yours was clear and spot on. Thanks man!
@johnshepard1267
@johnshepard1267 4 жыл бұрын
Thanks for the video, exactly what I was looking for!
@blueicer101
@blueicer101 2 жыл бұрын
I like this video, not because it's perfect or anything, but it shows someone using android studio and not just writing xml like everyone and their mothers.
@muminoloruntola2146
@muminoloruntola2146 3 жыл бұрын
You're a life-saver. Cheers This helped resolve 90% of my problems
@queenvillarin4496
@queenvillarin4496 2 жыл бұрын
BEST TUTORIAL EVER! THANK YOU SO MUCH YOU'RE A LIFESAVER
@h.r.60
@h.r.60 4 жыл бұрын
Keep up the great work, Legend 🙌
@Arman_127
@Arman_127 2 жыл бұрын
Хорошо что есть переводчик KZfaq 😄. Огромное вам спасибо за видео
@shinmasterx
@shinmasterx Жыл бұрын
to anyone whose app crashes when you do this. change the navhost package tag in activity_main.xml to just fragment or your app will crash. thank you so much to the poster of this video. you were very clear and easy to understand. it was just that little detail in the tag that was driving me crazy cuz my app kept crashing. lol. hope this helps someone!
@skyfeelan
@skyfeelan Жыл бұрын
for me it crashed because I used FragmentContainerView instead of fragment, I changed it to fragment and then it works fine
@Laughing-Pixels
@Laughing-Pixels 7 ай бұрын
Thank you so much!
@zolo375
@zolo375 4 ай бұрын
Thank you shinmasterx
@D3r_3k_
@D3r_3k_ 4 жыл бұрын
oh Thanks! sorry man, but if i want to combinate drawer navigation and bottom navigation with fragments. how would do it?
@theisikkala7918
@theisikkala7918 4 жыл бұрын
Thanks for the great tutorial, I've got it implementet and it works!!! Keep up the good work!
@fausto7394
@fausto7394 3 жыл бұрын
Hey you! You're very skilled with these design things! Thank you very much. Such an good explanation also
@developerkiwi8368
@developerkiwi8368 4 жыл бұрын
Do you try to add splash screen fragment to this project?
@alonsoescamillarc948
@alonsoescamillarc948 3 жыл бұрын
Short and useful tutorial thanks a lot!
@nitin88mehta
@nitin88mehta 4 жыл бұрын
Could you please share the source code of the following. I am having trouble importing correct libraries.
@maleehamuzafar
@maleehamuzafar 2 жыл бұрын
To the point. Amazing work, thank you for sharing!
@StevdzaSan
@StevdzaSan 2 жыл бұрын
You're welcome 😊
@mohammedabusnaimeh8076
@mohammedabusnaimeh8076 2 жыл бұрын
question :- if I go from second fragment to third fragment then press back its back to Fragment One(home start destination ) but must be back to second Fragment .why?
@hatty101
@hatty101 3 жыл бұрын
Does bottom nav view have any perofmance impact? i mean i have 4 views and i want the user to be able to switch between them. tab layout vs bottomnavview?
@dirtypaws17
@dirtypaws17 Жыл бұрын
If you add setOnItemSelectedListener for the menu, do you need then to manually add the transition to the fragments?
@seyhmusalatas1740
@seyhmusalatas1740 Жыл бұрын
Amazing work, clear explanation! Thank you.
@jacoblee89
@jacoblee89 3 жыл бұрын
i thought i was watching a speedrunner in mario maker but good vid tyvm!
@saravananmanoharan4114
@saravananmanoharan4114 3 жыл бұрын
Thank you so much for this!
@usamazafar337
@usamazafar337 2 жыл бұрын
I was stuck with the problem of switching the fragments when pressing the bottom navbar items but when i set the same id of fragments in my_nav and items in bottom_nav (menu) it runs succesfully.
@ferranescolano6491
@ferranescolano6491 4 жыл бұрын
Right now im having problems because the activity_main_fragment.xml is supposed to have instead of , do you know how to handle this?
@Feciboy
@Feciboy 3 жыл бұрын
Thank you! Helped me a lot!
@mkc0321
@mkc0321 3 жыл бұрын
short, precise and perfect explanation
@StevdzaSan
@StevdzaSan 3 жыл бұрын
Thank you 🙏💜
@hisanahsalsabila8248
@hisanahsalsabila8248 3 жыл бұрын
Thanks! for sharing this tutorial, very helpful
@albertperellacanelles1314
@albertperellacanelles1314 3 жыл бұрын
I have a problem with this: I have created the fragments, but i have a google maps activity, that i want to add in the navbar. I put it in my:nav.xml and detects that is an activity. When i run my app i can navigate normaly, but when i press in Maps button it crashes. Any solution to implements a normal activity?
@ahmedbasalib7598
@ahmedbasalib7598 3 жыл бұрын
Sir how to stop fragment recreation every time the tabs clicked? When one tab is clicked first time the fragment should be created but when the same tab is clicked second time I don't want to recreate the fragment so is there any way to achieve that?
@Ari-118
@Ari-118 2 жыл бұрын
It was a nice video but one thing I'd like to bring to your notice is that I didn't get to use app bar configuration object. Action bar's title was changing with just a method which is set up action bar with nav controller and with just one parameter navController. So why did you make that extra instance of app bar configuration?
@NiteSeek
@NiteSeek 3 жыл бұрын
Thank you so much my teacher didnt mention the fact that the icon item Id has to match fragment id found in bot nav menu
@cindyliang9367
@cindyliang9367 3 жыл бұрын
very clear and helpful!
@utksingh7
@utksingh7 3 жыл бұрын
how can I set a particular fragment as the starting fragment....which appears first on opening app
@AlanBlay
@AlanBlay 3 жыл бұрын
It's possible to save the state of the fragments between transition of fragments with this code?
@uio86a
@uio86a 2 жыл бұрын
Can I adjust the size and spacing of the navigation icon? Can I put in Chrome Icon and make the start menu and program list appear like Windows?
@nevermore5173
@nevermore5173 3 жыл бұрын
How can we do this inside a fragment and in Java? I tried my best but it won't work
@albertomagalhaes5118
@albertomagalhaes5118 2 жыл бұрын
How can I add transition animations between those fragments?
@user-ix5jb5jf6m
@user-ix5jb5jf6m Жыл бұрын
Hello, I have a question, how can I update a values other fragments, for example i have an app that can save some tasks, so i have one fragment to show tasks and another one to set and save tasks, but fragment pages do not refreshed or reload so it problematic to me, to show the added or updated data instead of just switching fragment I am turning off the app and turn un, so how can I solve it?
@wambunganga234
@wambunganga234 2 жыл бұрын
Great Explanation .Thank you
@aelafdev
@aelafdev 3 жыл бұрын
another applauder!!! thank you
@aozgunn
@aozgunn 3 жыл бұрын
Hi nice tutorial. How can I add gridView in Home Fragment ? I can create gridView other app in mainActivity bu I can't open gridView when I clicked home icon.
@lighttangoredox1573
@lighttangoredox1573 3 жыл бұрын
why my fragment didnt become class, even though they are class. i already follow all instruction rewacth video 3x. pretty sure im have same code with u. but the app crashed...
@ioannismitropoulos6754
@ioannismitropoulos6754 2 жыл бұрын
Nice work, very helpful video
@harshpatel-bt5wr
@harshpatel-bt5wr 3 жыл бұрын
how can we handle multiple navigation graph for managing multiple backstacks
@mohamadmf4105
@mohamadmf4105 3 жыл бұрын
4:22 to 4:23 What did input on keyboard to change coding style?
@jamieholmes6379
@jamieholmes6379 2 жыл бұрын
Also the java code for the AppBarConfiguartion is; AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(R.id.firstFragment, R.id.secondFragment, R.id.thirdFragment).build(); NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
@rockymalobago4075
@rockymalobago4075 3 жыл бұрын
Hello sir what is the your Button navigation dependency?
@lukefernandez949
@lukefernandez949 Жыл бұрын
Hi there i used your tutorial and it works perfectly but im facing the issue that it seems to override my start activity which is my login activity and launches this bottom navigation activity first each time. Is there any fix to this?
@abdremo
@abdremo 4 жыл бұрын
Very nice, thanks so much
@ethiomusic3158
@ethiomusic3158 3 жыл бұрын
It is good tutorial. I did all but when I click the icons, the app goes wrong and disappear from the emulator. And when I remove the fragments, I can see the icons but they don't listen at all. And the other thing is, I couldn't get the titles with the icons. Why? Android Studio couldn't detect me where I missed it. Please help me.
@computinghub9550
@computinghub9550 Жыл бұрын
What about `FragmentContainerView`? Should we use that instead from now on?
@maviniii
@maviniii 2 жыл бұрын
Thanks so much sir, it's working perfeclty. The only problem that i had was: Kotlin recreted a "Fragment" intead "fragment", and you didnt show us that we needed to create an id on fragment, in the line: 25 of "activity_main". apartfrom that, everything is working. Thanks
@allandrifqyputra4422
@allandrifqyputra4422 2 жыл бұрын
I like your way of explanation
@prasannadeshpande4435
@prasannadeshpande4435 3 жыл бұрын
Your videos are very helpful. Thank you very much.
@StevdzaSan
@StevdzaSan 3 жыл бұрын
You're welcome 👍
@theworldminusraphtheninjat4378
@theworldminusraphtheninjat4378 3 жыл бұрын
I have a question how do I stop the bottom navigation from recreating the view when its selected and I keep clicking on it like in your example if you keep clicking on any of the items it will keep recreating the corresponding fragment ?
@sambhusbabu
@sambhusbabu 3 жыл бұрын
Same problem... Help me to fix this issue
@leonardocorreiadecastro5701
@leonardocorreiadecastro5701 3 жыл бұрын
Thanks for help, you are my hero
@YoumojoJoJo
@YoumojoJoJo 3 жыл бұрын
I want to add the bottom navigation in a fragment?
@telloborneo3635
@telloborneo3635 3 жыл бұрын
great videos !!, Please make video about handling the backstack, its so difficult for me.., this is my cases, here the flow of navigation graph : 1. A-B-C 2. D-B-F The question is, how the B fragment knows, which fragment that called them, from A or D, i mean how to handle onBackpress, im glad if u have the solution, thanks dude!
@ManishKumar-lr9ig
@ManishKumar-lr9ig 2 жыл бұрын
I have one question . If I want to add two fragment in profile tab ... how to do that
@claire3264
@claire3264 4 жыл бұрын
Hi Stevdza-San I have error which is unsolved reference: R Can you help me to solve this problem please?
@pablovelasquez3147
@pablovelasquez3147 2 жыл бұрын
can you change the blue color of the selected item?
@Rafael-hk9pg
@Rafael-hk9pg 3 жыл бұрын
My BottomNavigationView is not showing up at the bottom, any suggestions?
@ericsatriawan674
@ericsatriawan674 Жыл бұрын
This is awesome. How about to swipe left and right those 3 fragments? I have no clue
@adityaaguswisanto7137
@adityaaguswisanto7137 3 жыл бұрын
how to create function method another fragment login goto bottom navigation with architecture component ?
@sjjayaswal7621
@sjjayaswal7621 2 жыл бұрын
Thanks for information 👍
@toBeABetterTranslator
@toBeABetterTranslator 3 жыл бұрын
NICE TUTORIAL! But every time I click the menu item, the fragment will be refreshed, causing crash. How am I supposed to deal with it?
@himanshumudgal8553
@himanshumudgal8553 4 жыл бұрын
Hii could you please tell about how to use searchbar in bottom navigation
@dyako926
@dyako926 3 жыл бұрын
why i dont have compile option in my gradle
@edycarreyes99
@edycarreyes99 4 жыл бұрын
It doesn't work for me!!!... The navigation between fragments doesn't work!.
@crooks5001
@crooks5001 3 жыл бұрын
It's not navigating fragments for me either :(
@andres1f1guti1s
@andres1f1guti1s 3 жыл бұрын
make sure you have the id of each fragment in each menu item: 4:30
@ryderr4453
@ryderr4453 2 жыл бұрын
Thank you so much for this excellent tutorial
@StevdzaSan
@StevdzaSan 2 жыл бұрын
Anytime!
@timverlinde8954
@timverlinde8954 3 жыл бұрын
Thumbs up for you my friend. Thank you!
@sergioeduardo3797
@sergioeduardo3797 4 жыл бұрын
Thanks for the video this really helped. Following the MVVM architecture does it make sense that the fragment handles the navigation or should I move this code somehow to the viewmodel
@StevdzaSan
@StevdzaSan 4 жыл бұрын
Not necessarily, fragments can handle simple navigation
@chil1t0
@chil1t0 9 ай бұрын
Can someone help me? I have the exact same code as the video with, the only difference is that a fragment from a nav_graph to an another activity (HomeActivity) with another (surely in the future) nav_graph navigation. The problem is that all navigation function well but the AppBar and the BottomNavigationView doesn't display at the activity and seems like it only renders the pure fragment with the text. can someone help me?
@nishaposwal3416
@nishaposwal3416 3 жыл бұрын
create destination is not working for me....is there any dependency needed?
@brunooliveira3931
@brunooliveira3931 6 ай бұрын
Please if anyone can answer me. How to customize the toolbar according to the fragment I am in?
@israelmityabeshet5970
@israelmityabeshet5970 3 жыл бұрын
Thank you!!!
@DavisTibbz
@DavisTibbz 3 жыл бұрын
You are the best!
@mohammadalameh9434
@mohammadalameh9434 2 жыл бұрын
Thank you worked 100% much appreciated !
@StevdzaSan
@StevdzaSan 2 жыл бұрын
Glad you like it buddy!
@mohammadalameh9434
@mohammadalameh9434 Жыл бұрын
@@StevdzaSan Hi I just want to ask you if you please this question: I created a button in the home fragment that takes me to a fourth fragment (not included in the navigation bar), and when navigating to another fragment from the bar, and then clicking the home button from the navigation bar, that 4th fragment is still, I want to return to the home.If u can suggest a way.Thanks!
@pandakaradi4959
@pandakaradi4959 3 жыл бұрын
Thx for the video. There is no tutorial like this if possible do that creating a list item with images from previous activity with eduit text and listview
@dryanwarrener
@dryanwarrener 3 жыл бұрын
Yo, my fragment overlaps my navbar. How do I fix that?
@footballfreak3987
@footballfreak3987 4 жыл бұрын
Is this a Java tutorial or Kotlin? and plz let us know ahead of time if you will be working with Kotlin or Java i like to stay consistent...Anyways great job sir thanks
@mehtabahmed4696
@mehtabahmed4696 3 жыл бұрын
How to get rid of fragment warning ⚠️ in the activity main
@Danc243
@Danc243 2 жыл бұрын
how do i navigate to a fragment that does not have BottomNavigationView?
@vapecat
@vapecat 2 жыл бұрын
How to make the bottom navigation disappear when i open another fragment?
@alexandryuschenko3334
@alexandryuschenko3334 3 жыл бұрын
Thanks bro
@pauljohn.ytchannel
@pauljohn.ytchannel 4 жыл бұрын
The fragment is always re created every time you tap new tab, how to solved that?
@theworldminusraphtheninjat4378
@theworldminusraphtheninjat4378 3 жыл бұрын
@@nevermore5173 how pls help i noticed it and i need help
@nevermore5173
@nevermore5173 3 жыл бұрын
@@theworldminusraphtheninjat4378 This is a fairy simple project I discontinued. I used that technique in this app. Take a look: github.com/Re1r0/StudyAssistant Edit: I used a custom library because it looks good. But the same can be achieved using Google's de facto bottom navigation view.
@musasoydas3122
@musasoydas3122 Жыл бұрын
thank you
@juliocamacho6298
@juliocamacho6298 3 жыл бұрын
excelent thanks
@kannapipa2270
@kannapipa2270 4 жыл бұрын
can you make a tutorial on draw over other apps? from your app to another app then have a layout over in that app.
@kourdassimohammedabderrezz9365
@kourdassimohammedabderrezz9365 4 жыл бұрын
i need the java version
@blueroaster8384
@blueroaster8384 2 жыл бұрын
hmmm when i call the menu instead of getting the icons i get the 'first fragment' wording
@anudeepananth
@anudeepananth 4 жыл бұрын
The fragments get destroyed when user moves to another fragment... is there a way to save the fragment state with this?
@sambhusbabu
@sambhusbabu 4 жыл бұрын
Same issue for me....
@anudeepananth
@anudeepananth 4 жыл бұрын
@@sambhusbabu So what I did was not use this navigation component library, I chose to add fragments and hide/show the other fragment based on user interaction, thus saving the states
@brandondelacruz2933
@brandondelacruz2933 4 жыл бұрын
Can you make a tutorial about the basics and advance tricks with recyclerView? I already know the basics, I just dont know how to make each element become clickable and have separate pages for each element each time theyre clicked.
@fausto7394
@fausto7394 3 жыл бұрын
Hello sir, did you found it? I can help with that if you want!
@quynhnguyen1018
@quynhnguyen1018 3 жыл бұрын
great tutorial
@ShivamMalik95
@ShivamMalik95 3 жыл бұрын
How to not display the text in the menu title? i want to just show the menu icon and not the title text with it take the space
@perfectoctogon2392
@perfectoctogon2392 2 жыл бұрын
Get rid of the Title attribute
@jeanmichel4269
@jeanmichel4269 3 жыл бұрын
I've done exactly what he is doing in the video and the app doesn't want to run in my device, as soon as I open it it stops automatically, someone has an idea why?
@Techavior
@Techavior 4 жыл бұрын
4:21 I liked how he selected all (Ctrl + A) then pressed the magic key, then all took his place like a good solders :) I've tried some keys and almost nuke my entire project, then I became like a good solder who must do boring stuff to my project :\
@StevdzaSan
@StevdzaSan 4 жыл бұрын
Ctrl + Alt + L
@ryanfosterthemagicegg1567
@ryanfosterthemagicegg1567 2 жыл бұрын
Thanks for making this comment since he replied.
@ChinhNguyen-eg5km
@ChinhNguyen-eg5km 4 жыл бұрын
Sir i have a question , when changing fragment in navigation , fragment will be killed and it's state will be removed, so how can i keep it?
@StevdzaSan
@StevdzaSan 4 жыл бұрын
OnSaveInstanceState
@ChinhNguyen-eg5km
@ChinhNguyen-eg5km 4 жыл бұрын
@@StevdzaSan hope u will make video about it , typical example is recyclerview-state when changing fragment , thank sir
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 6 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 14 МЛН
Bottom Navigation Bar With Badges - UX With Material3
13:17
Philipp Lackner
Рет қаралды 42 М.
Bottom Navigation in Android Studio using Kotlin | Android Knowledge
16:25
Everything you need to know about Kotlin 2.0 🟣
11:05
Stevdza-San
Рет қаралды 57 М.
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27