Questions tagged [drawerlayout]

Android's DrawerLayout acts as a top-level container for window content that allows for interactive "drawer" views to be pulled out from the edge of the window.

Android's DrawerLayout acts as a top-level container for window content that allows for interactive "drawer" views to be pulled out from the edge of the window. It is commonly known as Android Navigation Drawer.

As per the Android Design guide, any drawers positioned to the left/start should always contain content for navigating around the application, whereas any drawers positioned to the right/end should always contain actions to take on the current content. This preserves the same navigation left, actions right structure present in the Action Bar and elsewhere.

The DrawerLayout class is available in the Android Support Library (android.support.v4.widget.DrawerLayout).

Some Useful links - Official API Reference and Navigation Drawer Example

Tag Usage:

843 questions
10
votes
1 answer

Don't Dim Main Content When DrawerLayout Is Visible?

When using a DrawerLayout in Android, opening a drawer causes the main content area to be darkened. Is there any way to avoid this so the main content stays equally visible while the drawer is out?
Brian White
  • 8,332
  • 2
  • 43
  • 67
10
votes
1 answer

Gestures not working when using DrawerLayout in Android app

I have an Android app with a single Activity. This activity uses this layout:
David Moreno García
  • 4,423
  • 8
  • 49
  • 82
10
votes
6 answers

Android DrawerLayout is not working with ViewPager?

I have implemented ViewPager inside a DrawerLayout it is working properly but Drawer menu list view not displaying properly with the action bar it will display below the ViewPager tabs.Hope following figure will give you an idea. And i am using…
9
votes
4 answers

How can we change ActionBarDrawerToggle icon?

I'm new with Android and in my app, I am using DrawerLayout, it's ok and fine. But I want to change ActionBarDrawerToggle icon. How can we change it? I tried a lot but I could not able to achieve the desired result, please help me…
Krish
  • 4,166
  • 11
  • 58
  • 110
9
votes
2 answers

Android DrawerLayout component

I have some problems with the DrawerLayout component. I'm using the android-support-v4 jar and when I'm launching the app I have this exception : 05-19 01:33:57.402: E/AndroidRuntime(3120): FATAL EXCEPTION: main 05-19 01:33:57.402:…
Kyu_
  • 800
  • 4
  • 10
  • 18
8
votes
1 answer

Drawer layout with navigation component - Listener on only one item

I've got an issue concerning the implementation of a Drawer Layout with Navigation component. I have created the drawer layout using the include Navigation Drawer Activity of Android Studio. Actually, all is fine if the menu items purpose is to…
8
votes
1 answer

Adding a Navigation Drawer to an existing ConstraintLayout Activity

Is there any way that I can modify the XML file of my main activity (the one that I wish to add a navigation drawer to) so as to allow for my existing layout to remain while adding the navigation drawer? My current code is as…
user5992911
8
votes
3 answers

Android: Transparent status bar with dynamic actionBar colors and DrawerLayout

I have an activity with a DrawerLayout. Our client requires us to dynamically change the action bar color and the corresponding status bar color of this activity depending upon the item selected from the DrawerLayout. This is easily done. However,…
user6464793
8
votes
1 answer

setDrawerLockMode not working in android?

I want to lock swipe left-right and right-left of DrawerLayout. DrawerLayout drawerLayout; onCreate: drawerLayout = (DrawerLayout)…
rome 웃
  • 1,821
  • 3
  • 15
  • 33
8
votes
4 answers

Add MenuItem to NavigationView with Icon and Title?

Right now I am trying to implement the DrawerLayout/NavigationView from the new Design Support libary (22.2.1) into my application. I already searched on the internet and especially on stackoverflow how to add a MenuItem to a Submenu with Icon and…
pimato
  • 89
  • 2
  • 7
8
votes
2 answers

Runtime DrawerLayout must be measured with MeasureSpec.EXACTLY excpetion

I'm following this tutorial from and I'm facing with a strange problem. It doesn't matter what's in my DrawerLayout, but if its layout_height or layout_width are set to anything other than hardcoded number, it throws this runtime exception. I've…
La bla bla
  • 8,558
  • 13
  • 60
  • 109
8
votes
1 answer

Why i can't lock DrawerLayout with layout gravity

I use DrawerLayout and recently i want to change gravity of listView in drawerLayout. But after i change gravity of listView to android:layout_gravity="start|bottom"from android:layout_gravity="start", drawerLayout can't be lock to…
Sinan Kozak
  • 3,236
  • 2
  • 26
  • 32
8
votes
8 answers

How to show the DrawerLayout when sliding from left to right, no matter where?

background google has introduced the DrawerLayout, which shows a menu on the left area of the screen when you click on the "up" button of the action bar. because the library isn't supported yet on actionBarSherlock, there is already a way to…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
7
votes
1 answer

Android DrawerLayout - openDrawer with Gravity.Start creates a lint error "Must be one or more of..."

I have created a DrawerLayout and also have an ImageView (a 'hamburger') that opens it when clicked. My problem is that when using the following code, a lint error is shown in AndroidStudio: Must be one or more of: Gravity.LEFT, Gravity.RIGHT...,…
MikeL
  • 2,756
  • 2
  • 23
  • 41
7
votes
2 answers

Transition in navigation drawer android

Anyone having idea that how to achieve this type of transition. When we open Navagation drawer full screen is getting animation like this. I also looked at reside menu but here menu is predefined not as i want. I also tried with NavigationDrawer but…
AMAN SINGH
  • 3,491
  • 6
  • 28
  • 44