Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016)

Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016) - Hello friends Android tutorial and tips trik, The article you are reading this time with the title Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016), we have prepared this article for you to read and download the information therein. hopefully fill posts article -, article (LATEST, article (Part, article #3, article 2016, article android, article Drawer, article Hamburger, article Menu, article Navigation, article Right, article Studio, article Tutorial, we can write this you understand. Well, happy reading.

Title : Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016)
link : Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016)

Baca juga


Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016)

Hello everyone, my name is Oum Saokosal, thisis the part 3 of the navigation drawer in Android Studio.

You can watch the previous video, part 1 andpart 2, at my channel.

You can contact me on:Facebook.

Com/kosalgeek twitter.

Com/okosalYou can download some source code at github.

Com/kasolgeek as well.

In the first video, I talked about the basicnavigation drawer, the basic UI and the fragment.

Part 2, I talk about views and how to addthe views on the fragment, Event Handler and List on the fragment.

In this video, I will talk about how to changethe navigation drawer from the left to right and add some animation.

Okay, this is the example from the previousvideo.

We already made a menu for that and add someitem on this and List View, okay.

Now, we want to change the position.

So what we have to do, first you go to theactivity_main here and here you change from the START to END and the layout_gravityto END as well and you want the size maybe a little bit smaller.

You can change the width, maybe 200dp, okay,and then you go to main activity and hear what you have to change is here.

You want to change to END as well and thisone is very important when you want to prevent the user from, let's say you press back whileyou are here, when you press back this, usually the back acts like an exit button, okay.

So in here on back press, it prevents thecode from exit the application when you are in the opened navigation drawer.

Okay, so now we want to change from the startto end and then here the last part of the on navigation icon selected.

Here you want to change to END as well.

This one happened when, let's say, you arein fragment.

Let's say now you are in one particularfragment and when you click on another fragment on the menu, then the navigation drawer willclose, okay.

So now, we change to END as well, and whatelse? Here in the application, let me run it! You don't have the menu, the Hamburger menuon the right side, instead you have to use the, what you call it, the menu here, thesetting here to be the Hamburger menu.

So what you have to do, you go to main menuhere and maybe I want to change to menuRight and this one.

When you say never, it's gonna hide insidethe three dots menu, and if you say always, it will show, okay, but now you want to changethe icon and for the icon maybe you can find a good one from the internet, a similar oneto the Hamburger menu, but for me I just use this one that i just downloaded and copy andpaste to the drawable menu here.

Yes, now I can call it drawable and then users.

So, suppose it is the one that we want toadd a user, you can have other item as well, okay.

This is just an example, okay, nothing specialbut the one that you want to use.

It's the menu right, okay, so you go backto the main activity here and in here the onOptionItemSelected here.

Now, we change to menu right.

What you have to do is call the drawer, butwe don't have the drawer because the drawer is inside the onCreate.

So, now just copy to the outside and leavethis one like this.

Now you are free to use the in navbar methodas well.

So you say if drawer is open from the right,then you close it, else then you open it, okay.

So this is the most important part.

You want the menu acts like a Hamburger menuinstead, so right click on this.

You can see now the menu is from the rightokay and this one is no longer used, so you want to disable this button.

What you have to do, you go to toggle andsay toggle set onDrawerIndicatorEnable and you set to false, then there is no Hamburgermenu.

Now the Hamburger menu is from the right andwhen you click on the back, now it acts like how you want.

Click on this, okay.

So the last part of this is the animation,but before the animation, but before the animation, I want to point out something, maybe you noticeit or not, but when you first started you don't see anything just a blank one, actuallyit's not good, you want to have one fragment absolutely for one, so maybe you want to choosethe first one, okay, so to do that it is very easy, you go to the code for the fragmenthere, just copy and then paste in the onCreate method and maybe at the last part of this.

Now you have the default fragment and whenyou click on another one, just like okay, but the animation for this is just a verybasic one.

So now we're going to move to the animation.

The animation for the transaction is verysimple, what you have to do first, you go to the res and new directory and you can callanim and you can call the folder name for everyone and I have my own animation.

This one is for the slide-in and from leftand slide out from left, so what you have to do is to change maybe the duration andthe X now is -100% and to X1 of 0% and then you want to move out from 0 to 100 okay, andthis is for the offset fromXDelta is offset.

This is a simple animation.

If you want like fighting, you may find somemore useful information from Google, but it is just some basic one and you can just changeit easily.

Here is the manager okay, around here, yougo down and say setCustomAnimations.

You need two parameters, 1st one is the enteras you can see and the exit.

So the enter is slide-in and exit is slide-out.

So you call by R.

Anim_slide_in_from_left andexit is R.

Anim_slide_out_from_left, okay.

You just copy and paste to the other ones, that's all, ok.

See that! Now the animation looks better, okay.

That's it for this video.

I know there are more to learn about the navigationdriver, but I covered all of the basic features of the navigation drawer.

I hope you like it and please don't forgetto subscribe my channel and I will see you in the next video.

Thank you.



Thus Article Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016)

That article Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016) This time, hopefully we can give you all of the benefits. Well, I'll see you in another article post.

You now read the article Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016) the link address http://svedda79.blogspot.com/2016/07/latest-android-studio-navigation-drawer.html

0 Response to "Latest Android Studio Navigation Drawer Tutorial (Part 3) - Hamburger Right Menu (2016)"

Post a Comment