Hello I'm GAFCON and welcome.
Demand what tutorials in today's video we'll be talking about bottom navigation.
So what is it.
It is a menu at the bottom of the screen to navigate between views of fragments.
So let's get started.
Let's create a new project K let's call our projects a bottom navigation menu tutorials.
So bottom nav menu do look to the next button.
Let's keep on minimum as the guest theme.
Why.
So that we can run our application on almost 100 percent of the devices running Android in the world.
Let's hit the next button.
Let's start with an empty activity let's call a doctor.
This may not duty.
Let's hit the finish button.
Well I'm ready to do this building up project.
So let's wait what about this bill.
I'm excited to go well to use a bottom navigation view.
They need to order dependency on the grid.
So let's do that first.
So coming to greater obligation greater on let's other dependency issue.
So implementation
gone dot Android dot support design and religion which is twenty six one to one point zero let's degree
dosing.
Now let's wait Well McGraw don't think we're ready to do the design support library so let's close this
on.
Let's just close this as well.
Coming to Our allowed five first let's get rid of this constraint layout so to use a bottom navigation
view the building level or the main there should be a coordinator level.
So let's add that here.
So according to do layout let's come down here and let us know what navigation view.
So bottom navigation view you have much bearing high drop content.
Let's remove this and this requires you to examine the file and populate the navigation menus.
So let's create one.
So coming to project obligation resources.
Let's create a new resource directory so unregistered directory let's call that menu on the top.
OK again going to menu right click new menu resource file.
Let's call it bottom menu.
And that's an OK button.
Let's switch to the tax mode on close this let's create a first menu item.
Droid a title do go out.
I didn't need a string.
And for that need to define the string in the string start exam.
So let's do that.
So project resources values on string good example.
Let's create two strings you.
That's designed three menus and for three minutes we were eating three strings so let's define all those
three string resources here so strings a SDR home let's call it home similarly let's create another
so let's call it string about us.
So about us let's add another and let's call it a star contact us.
Contact us let's call it conduct us OK mustering resources already so.
Going back to the menu for example let's use this free resources here.
So SDR home that's provided with an idea so let's call it same menu.
Who similarly that our other two.
So I do.
Let's go like the title let's call it about us.
Let's go I have an idea.
So menu about us similarly.
That's another throughout the title.
So SDR contact us Android and Ivy.
So menu.
Contact us OK.
Three menu items already.
That's all I can say for these as well.
So we need some icons of sauces or some dry blue sauces so coming to project resources right click
new on Richter asset.
Let's click.
I'm for.
That search home.
So this all looks good.
Let's select this let's call it.
I see.
Home to the next button.
And that's created.
Similarly LEDs are icons for the do so new rector upset.
Let's click here.
For about us we can use this one see assignment one.
OK.
Let's hit the next button on let's click on the finish button.
Let's another resource resource new Richter upset on the last one is conduct.
So let's use an e-mail icon so e-mail.
Let's use this one.
OK let's just rename it.
Do I see e-mail let's hit the next button.
Finish button.
Well we've got three rivals for our three menus so let's use them here.
So I can say well I see home similarly for about us.
So I can draw a bow I see.
Assignment on similarly for this one so I can I see e-mail.
Well many fighters ready so coming back to our example let's try the menu find a few.
So which was what the menu.
OK.
Let's have a look at the preview.
Let's bring it to you.
So as you can see it's on the so let's bring it at the bottom.
So let's go and mail gravity say welcome.
So now it's in the bottom.
Let's change the colors.
So let it be set loose.
So background color trying to draw let's change the color for icons and text so Bichon friend let's
call it Android go to white.
And similarly for text so I don't text color.
Android color white.
OK well look just at an idea.
So say bottom nav menu.
Let's run our obligation and have a look.
Let's close this on one our obligation
Oh sorry.
We've got an error here so let's fix not we just miss those three dogs plus idea let's run the application
again.
Well applications are running so let's have a look.
Roll up obligations Sure.
Let's click on About Us Contact Us.
Oh.
So let's you know just some even on these flicks.
So coming to our Java file let's create an instance of our bottom navigation menu.
So private bottom navigation view.
OK.
Let's initialize it.
Find Hubert Ida or the IDA.
Or on another menu.
Okay so what another menu set of navigation items select listener.
So let's this okay.
Again it's a menu item.
So did you switch gates on the basis of ideas so switch item not yet item Heidi.
OK.
That's not a case of I.D..
If you're going to remember the ideas for a menu I'm going home about that and contact us.
So let's use those.
So menu.
So let's.
Generally dose you so does not make decks.
Let's go I can take some inactivity on this.
Let's go right a message.
So clicked home.
Let's throw out the duration of the short on let's call the show function.
OK.
Because this needs to be done a boolean.
So let's just return true.
Let's up another case.
So ordered a menu about us.
Let's generate a toast.
Let's just the base a few.
OK.
Let's just change the message so plagued about us similarly.
That's another case.
So it bothered me so many who contact us OK.
That's just seems the message so contact us and let's out a default case so default return false.
OK.
So let's run it up big issue again
low or obligations running so let's have a look let's click on the whole button.
So it's a like home.
Let's click on Contact Us.
It says contact us.
Let's write about us.
Says click about us.
Well your own rendering.
You can render anything a figment of you.
That's all about navigation use if you have any doubts any queries feel free to drop a moment and then
go through it again.
Well like.