Questions tagged [navigation-drawer]

Navigation Drawer in a mobile application is the side panel which slides out from the edge of the screen and displays the navigation menu of the application. Use this tag for programming questions related to navigation drawers only. General UX questions and other opinion based questions related to navigation drawers are not on topic for Stack Overflow.

Navigation Drawer in Android

The navigation drawer is commonly used as a "slide-in" navigation menu in Android applications. It slides in from the edge of the screen and displays a list of the application's main navigation options.

The drawer slides on top of the content instead of the content sliding away. With this, one can access any top level content from anywhere in the app and allows you to create a flatter navigation structure. It also has an action bar at the top. Lower versions also support it through support library.

Documentation

  • Design docs can be found here.
  • Developer docs can be found here.
  • DrawerLayout API reference can be found here.

Related tags:

5793 questions
58
votes
5 answers

How can I add a custom item to a NavigationView with a menu layout?

I've been experimenting with simplifying some navigation drawer code by making use of the new NavigationView class in the Android design support library. It works great if you just want icons on the left, and text on the right like in the example in…
Tim Rae
  • 3,167
  • 2
  • 28
  • 35
57
votes
4 answers

Change NavigationView items when user is logged

My app's main activity has a navigation drawer, instantiated in the XML in this way:
Marco Zanetti
  • 4,051
  • 6
  • 32
  • 48
56
votes
5 answers

How to show/Hide Navigation Drawer programmatically

How can I use button to show/hide Navigation Drawer, I have used this SO link to create and manage Navigation Drawer. Now i am using (Swipe to right from left - to show) and (Swipe from right to left - to hide) How may I show/Hide Drawer using…
Sun
  • 6,768
  • 25
  • 76
  • 131
55
votes
9 answers

How to reset the Toolbar position controlled by the CoordinatorLayout?

The app I'm working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows:
55
votes
5 answers

Navigation Drawer to switch activities instead of fragments

Is it possible to use a navigation drawer in android but instead of updating fragments, i would like to switch between activities as my means of navigation within the app.
SleepNot
  • 2,982
  • 10
  • 43
  • 72
54
votes
5 answers

Change the color of Navigation Drawer indicator icon

I am using a toolbar in place of actionbar and i am also using a navigation drawer.My toolbar colour is black and i want my navigation drawer indicator colour to be white.So how to change the colour of the navigation drawer indicator or put a custom…
Animesh Jena
  • 1,541
  • 1
  • 25
  • 44
53
votes
7 answers

Optimizing drawer and activity launching speed

I'm using the Google DrawerLayout. When an item gets clicked, the drawer is smoothly closed and an Activity will be launched. Turning these activities into Fragments is not an option. Because of this, launching an activity and then closing the…
yarian
  • 5,922
  • 3
  • 34
  • 48
52
votes
10 answers

Change Flutter Drawer Background Color

How can I change the background color of a flutter nav drawer? There doesn't seem to be a color or background-color property.
AlexL
  • 962
  • 1
  • 10
  • 13
52
votes
4 answers

Disable dark fading in Navigation Drawer

Is there a way to disable the dark fading effect for the background view in the Navigation Drawer View in Android?
Archedius
  • 2,887
  • 3
  • 20
  • 24
48
votes
6 answers

Android Change Navigation Drawer Menu Items Text programmatically

I have the new Navigation Drawer in my app and I want to change the navigation view menu items title text dynamically from code. I have watched many posts but I can't figure out, how can I do this. How can I achieve this…
user3065901
  • 4,678
  • 11
  • 30
  • 52
48
votes
16 answers

Clicking hamburger icon on Toolbar does not open Navigation Drawer

I have a simple android.support.v7.widget.Toolbar and all I am trying to do is to open a NavigationDrawer by pressing the "hamburger" icon in the top left corner. The "hamburger" button is visible, and when I start to pull from the left I see the…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
48
votes
5 answers

Disabling navigation drawer, toggling home-button/up-indicator in fragments

The setup I have an activity whose contentView is an instance of a DrawerLayout, which has a navigation drawer with a drawer indicator displayed in the action bar. The activity contains a Fragment, let's call it ListFragment, which contains a list…
Catherine
  • 13,588
  • 9
  • 39
  • 60
47
votes
7 answers

How do I make DrawerLayout to display below the Toolbar?

How to make the drawer layout be below the actionbar/toolbar? I'm using v7:21 app compat library with the new ToolBar view. Examples that I see looks…
46
votes
7 answers

DrawerLayout's item click - When is the right time to replace fragment?

I'm developing an application which uses the navigation drawer pattern (With DrawerLayout). Each click on a drawer's item, replaces the fragment in the main container. However, I'm not sure when is the right time to do the fragment transaction? When…
45
votes
5 answers

Android ripple background color

I am using a ripple effect on my navigation drawer. I have set it like this and applied it to my ListView: