♫INTRO MUSIC PLAYING♪
Hey what's going on guys welcome back to another brand new Android Studio!
tutorial so in the past tutorials we have learned about using many other
kinds of activities we learn about main steps in Android app so taking a short
look we can see we have learned about that using middle you can customizing
the UI interface over of your Android app and they we also learned about using
some other kind of widgets like toast then snag ball floating action button
and many other things so today we are going to learn about
using the navigation drawer in Android studio so let's get started we how the
Android studio over here I'm going to create a new project by this time we
have learned about the empty activity and the basic activity and every time we
are going to learn about the navigation activity in this tutorial so by default
it is my application I don't want to change it as it is our test program so
I'm clicking the next setting all the things are default and here in this
activity window we have learn about the empty activity and basic activity and
now we are going to learn about the third one which is navigation drawer
activity in which we have almost everything same as from the basic
activity and the one thing that we get in this way in this navigation drawer
activity is that we also get a navigation window which is actually you
can able to get this maybe in most in case you may have seen this is this
window and it is actually something that you swipe from left to the right and
they you will see this little pop-up window anyway we are going to select
this one and click on the next and I just want to change the title into
navigation or home by default most in case we use the navigation drawer
activity as our home activity so I'm trying to give it as home and clicking
the finish now it's take a little time so I'm going to skip that
setup okay so now that building has been completed and we have the product in the
Android studio so looking into this project you can see it's almost same as
that we have what what we have got after the building process of a basic activity
so we have the layouts activity main then we have the current main as same as
from the basic activity and we have new two other things one is the app ball
main door XML never had the main door XML so these are two XML that we get
from this navigation drawer and just going to the middle we can see here is a
new guy which is activity main draw or Direction L and also we have where the
values we have almost everything same so now what we have to do is let's go to
the Java and we have the main activity which is actually opened over here so
everything is same as from the basic activity so let's move to the Java and
you can see there are a little bit more cores over here which is here is it the
drawerlayout declared with the variable name as drawbar and you can see some of
the little things it's not that complicated it is pretty easy and we
have seen most of this course in these previous tutorials and here is one of
the new code which is a new method that is one navigation item selected so this
is going to perform when we select an item from this navigation drawer and
they finally draw over and some other things so anywhere let's move to the new
order made file and here you can see this is how the graphics in the
navigation drawer look like we have an image view to text views with the
different styles and now let's go to the app bar main door XML and it's same as
what we have seen in many other things it has a floating action button toolbar
and a work area and alone let's go to the drawable and we
a lot of drawable files and they here is one of the new guy which is a site in
airball let's open that turn the preview on you can see here is different three
different colors and now it's it looked like a gradient colors it's not almost a
solid color it's a little bit different one and this draw bow file is going to
run on this now hunter this side now bar is going to be the background for this
now header which is going to be the drawable or the graphics file of this
navigation drawer so anywhere from the next tutorials onwards we will be
discussing about how to customize each and every item of this so basically the
navigation drawer is used to switch from one window to another without losing
this navigation drawer which means that if you select the navigation drawer item
one then you can always scroll from left to right and select that the second
second item from the navigation drawer I know that it is not clear for you but I
will be explaining it in detail so getting started with the navigation
drawer activity I have seen that most of the people who are using the navigation
activity in a different manner which is going to be exactly not the way that
navigation or activity should be used so what I have seen is that there are a lot
of people's who are using navigation drawer activity again and again and
again just to do and switch from one activity to another so that they can
able to keep using that navigation drawer the way that the navigation
drawer is going to work is just by using the fragments so if you switch from one
act one item to the other one from the navigation drawer the the only thing
that change is the fragment and not the activity file so navigation drawer
activity is a stable activity which is going to stay as same and the only the
work area is going to be the different fragment that we use in this work area
which is this canal main and this activity main so inside this contentment
we are going to add different different fragment
and there and according to that fragment activity we are going to add its
corresponding Java file so in total what it means is that if you change your
activity from one to another it's only the fragment is going to change and the
navigation drawer activity will be stable and it's not going to change you
can able to get the navigation drawer in any activity that you often in this in
this navigation drawer and will be also discussing what is a fragment and how we
can create that fragment activity in the upcoming tutorials I know it's a little
bit confusing so let's take the Google Playstore as an example in the Google
Play Store we have seen there is the navigation drawer which we use it to
switch from the stroll area into the settings or accounts and many other
things so in that case we have seen the navigation drawer is tilde even if we
switch from the stroll to the settings and accounts and many other things even
even at that time also there is the navigation drawer which means the
navigation drawer is a freezer item which is lock code and the only thing
that changed when we switch from one item to another of the navigation drawer
it's a fragment in case of the fragment like we have seen in the empty and many
other activities fragment will contain a Java class and a layout file as I have
said before we'll be discussing the fragment in the upcoming series so in
the next tutorial we'll be going to learn about using the items in
navigation drawer and upcoming tutorials we'll be discussing about the fragment
and how we can able to use it in our Android app so I hope you guys got a
little bit idea from this tutorial and then and I'm pretty sure that there will
be a lot of questions that you have to ask me regarding this navigation drawer
but anyway we will be discussing and all of the things in the comment section and
upcoming tutorials and I'm pretty sure that you all your doubts will be cleared
in the coming tutorials so thanks for watching,
I hope to see you in my next video!
//Peace Out\\
-- Visit Our Website --
No comments:
Post a Comment