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
15
votes
4 answers

Android: NavigationDrawer/multiple activities/same menu

What I am trying to do, is have a NavigationDrawer menu like this: NavigationDrawer I've figured out how to change layouts when menu items are clicked, but how do I load a new activity without losing the menu? My main question: For example let's…
Lambros
  • 817
  • 1
  • 6
  • 14
15
votes
3 answers

NavigationDrawer with Activities vs. NavigationDrawer with Fragments

Take for example the app I'm currently working on: - it has an navigationDrawer with multiple items; there are two items which interest me for now, i'll call them X and Y. both X and Y, when clicked on, display a fragment containing a list of…
15
votes
5 answers

Drawer indicator in lollipop play store

I am using a Nexus 7 with the Android 5.0 preview build. On this page http://developer.android.com/tools/support-library/index.html I see Changes for v7 appcompat library: Updated ActionBarDrawerToggle, which contains the menu-to-arrow…
15
votes
1 answer

How to slide the ActionBar along with the NavigationDrawer

What I want to do is slide the ActionBar along with the NavigationDrawer when the drawer is opened. I am currently not using any third party libraries and if at all possible I want to keep it that way. All i need is an implementation of method like:…
15
votes
3 answers

Navigation Drawer : add headers in listview

I have created a project with the new navigation drawer Object. I would like to customize the layout of the menu, to add another object like TextView, ImageView ... And for begining, i would like to modify the default layout which is composed only…
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
14
votes
2 answers

Add drawer toggle button in Jetpack compose

I want to add the hamburger icon to the Appbar and open/close drawer using the icon. How would I achieve this? Scaffold( drawerShape = RoundedCornerShape(topRight = 10.dp, bottomRight = 10.dp), drawerElevation = 5.dp, drawerContent = { …
14
votes
2 answers

Navigation Drawer's Fragment Management

I am developing an app where i am using only 1 Main Activity and Multiple fragment, Including ViewPager , Custom video/Image Gallery, Fullscreen Fragment(Without toolbar or bottom navigation button). I am not sure is it good practice or not but i…
14
votes
7 answers

What is going on with my Android Navigation drawer activity?

I am building an OpenGL live wallpaper. I decided to have a Navigation Drawer in my main activity since there are a lot of features the user will have access to. The problem/issue If I press the "hardware" back button to normally close an app the…
Steve C.
  • 1,333
  • 3
  • 19
  • 50
14
votes
1 answer

How to style Menu Items in Navigation Drawer in Android?

I want to add style the Menu Items inside Navigation Drawer but I am unable to do so. I have looked up for some answers but couldn't done it. Can anyone help, I would be grateful. I am using the following theme Theme.AppCompat.Light.DarkActionBar…
14
votes
4 answers

navigation header layout cutoff from top

i am using navigation view with expandable listview. i am adding header layout programmatically. but it cut off from top. if i give header layout height to 240dp than it looks ok but in lower version it take to much height. heres my header layout…
Pramod mishra
  • 615
  • 6
  • 16
14
votes
4 answers

Android Studio navigation drawer like Gmail app

We're making an android app, and there is something we want to add. Which is the effect the Gmail app has. You can choose which account you want to view (and the rest of the app will behave accordingly). EDIT: I now already have a (working)…
Tvde1
  • 1,246
  • 3
  • 21
  • 41
14
votes
6 answers

Can I listen to when the Navigation drawer is opened or closed (e.g: listener like button onclick)?

I want to call some methods when Navigation Drawer is opened & closed. How can I listen to it (like button's onclick listener) ? I know we can check (mDrawer.isDrawerOpen(Gravity.LEFT)) or ((mDrawer.isDrawerClose(Gravity.LEFT))). Thanks in Advance.
Venkatesh Selvam
  • 1,382
  • 2
  • 15
  • 28
14
votes
5 answers

Navigation Drawer menu items selected within different groups

I have a working Navigation Drawer and having some issues with menuItem.setChecked(true); when using groups and headers within the menu. It's not highlighting menu items as expected. Here is my XML:
Jammo
  • 1,838
  • 4
  • 25
  • 39
14
votes
5 answers

How to Adjust the width of navigation drawer in android studio

I downloaded a navigation template, and I want to adjust the width of navigation. I've tried different methods but I think nothing suited. How can I solve my problem? I can't adjust the width of the navigation drawer. This is my code for the…
KennethLazos
  • 731
  • 2
  • 6
  • 8
14
votes
3 answers

Background image dimension for Navigation Drawer header

Basically I liked the background used by Mr. Jonathan Lee for Navigation Drawer header back ground in google official link http://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-content So I wanted to reproduce something…
abdfahim
  • 2,523
  • 10
  • 35
  • 71