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

What do you need to pass to v4.widget.DrawerLayout.isDrawerOpen()/.openDrawer()/.closeDrawer()

I've been trying to move my code across to the DrawerLayout as suggested by android here as SlidingDrawer is deprecated. My problem is that so far DrawerLayout seems to be either very badly implemented, has unhelpful error messages (no defensive…
Graeme
  • 25,714
  • 24
  • 124
  • 186
25
votes
5 answers

how to create smooth navigation drawer

I am using this example for navigation drawer. When clicking on of item of left drawer listview it shows some images but drawerLayout closes not smoothly. What should I do here for smoothly close left drawer layout after clicking of the item of…
fish40
  • 5,738
  • 17
  • 50
  • 69
25
votes
3 answers

How to add title in Navigation drawer layout?

[UPDATE] I solve the problem by adding addHeaderView : protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTitle = mDrawerTitle = getTitle(); …
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
25
votes
5 answers

Android Navigation Drawer and windowActionBarOverlay = true

I'm trying to implement the new Android Navigation Drawer in my application. I have created a BaseActivity.java that handles the Drawer setup and listeners, and I have two subactivities that extend this base class. On the second activity, I plan to…
daniel_c05
  • 11,438
  • 17
  • 60
  • 78
24
votes
5 answers

Navigation Drawer: Add Titles to Groups, Not Items

I have a standard Navigation Drawer, pre-created by Android Studio and want to populate it with number of groups. I started with this:
Neurotransmitter
  • 6,289
  • 2
  • 51
  • 38
24
votes
9 answers

Navigation Drawer lag on Android

I'm having a problem with Navigation Drawer , it is too slow, the solution I'm looking for is to close the drawer first and then show the activity, but It is not working, certainly I'm missing something. private class DrawerItemClickListener…
AND4011002849
  • 1,971
  • 8
  • 38
  • 81
24
votes
9 answers

How to Display Navigation Drawer in all activities?

I have a Navigation Drawer which should appear in all my activities. I saw many questions similar to this & found a solution like Extending the MainActivity with the Other Activities . So i extended My Main Activity to my Second Activity.But the…
AruLNadhaN
  • 2,808
  • 5
  • 24
  • 42
24
votes
7 answers

navigation drawer hide keyboard when onDrawerOpened

I have a fragment with edittext in it. when i click the edittext, the keyboard show up. the problem is when i open the drawer, the drawer does not hide the keyboard. the keyboard is still showing even i switch to another fragment. How can i hide…
SooCheng Koh
  • 2,271
  • 3
  • 21
  • 34
23
votes
2 answers

Android Navigation Component has lag when navigating through NavigationDrawer

I am updating my app to Navigation Architecture Components and I see that it has a lag replacing fragments which is visible in the NavigationDrawer that does not close smoothly. Until now, I was following this…
23
votes
6 answers

Navigation Drawer Menu Item Title Color in Android

I have a problem changing the Menu Item Title Color in the Navigation Drawer I set the itemTextColor but it only changes the Color of the Items not the Title of the menu. Here is my Activity_main.xml
23
votes
5 answers

Badge notification over drawer toggle in toolbar - Android

I want to notify user about new unread message in the app which is accessible through navigation drawer. I was thinking about notification badge something similar Apple have but over drawer toggle in toolbar. This is what I have now: This is what…
Soriyyx
  • 873
  • 3
  • 15
  • 31
23
votes
1 answer

Appcompat Toolbar Not Showing With Navigation Drawer

I am trying to configure the following in my app: Toolbar (Appcompat v7 version) Navigation Drawer Pre-Lollipop Appcompat v7 Material theme I followed the instructions here:…
23
votes
1 answer

Removing and adding activities to the back stack

In the "System Back after cross navigation to lower hierarchy levels" section of the Navigation Drawer, they say: If the user navigates to a lower hierarchy screen from the navigation drawer and the screen has a direct parent, then the Back stack…
aleb
  • 2,490
  • 1
  • 28
  • 46
23
votes
3 answers

How to add "menu" indicator next to Action Bar's app icon?

At least Gmail and Youtube Android apps use a side menu (navigation drawer?) that opens by swiping, or by clicking the app icon (home button): Is the menu indicator / icon in the screenshot above a ready-made part of Android SDK? (Or a custom icon…
23
votes
1 answer

How to properly design/style a Android Navigation Drawer

Im having trouble find any resources on how to properly design a standard Navigation Drawer. I've got the below XML and am looking for ways to Populate multiple listviews, change font of text in listview etc. Im trying to design similar to some of…
Jaison Brooks
  • 5,816
  • 7
  • 43
  • 79