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
7
votes
3 answers

CoordinatorLayout NullPointerException in onTouchEvent

I am getting NullPointerException in onTouchEvent of CoordinatorLayout. I am using DrawerLayout with CollapsingToolbarLayout of android support AppCompat v23.0.0 library. My observation is crash happen randomly while scrolling…
7
votes
3 answers

CoordinatorLayout does not hide Toolbar on scrolling despite implementing all required parameters

Here is my setup, i am running a DrawerLayout, within it is a CoordinatorLayout containing an AppBarLayout and a nestedscrollview. I am trying to have the nestedscrollview scroll normally and the Toolbar to get hidden on scrolling down and reppear…
7
votes
2 answers

Can I use SwipeRefreshLayout inside DrawerLayout?

Both layouts are available in appcompat support library 7. I am not getting proper result of of it. I have DrawerLayout as root layout and then inside it one error text view. followed by a SwipeRefreshLayout That textview was visible when root…
7
votes
6 answers

DrawerLayout on top of Actionbar

When using the drawer layout is there a way to overlay the drawer view over the action bar? I do not want to hide the action bar when the drawer is shown. I want the action bar to simply stay put, but be sent to the background. An example of this…
MCR
  • 1,633
  • 3
  • 21
  • 36
7
votes
1 answer

How to wrap DrawerLayout around PreferenceActivity in an Android app?

I am writing an Android app to take advantage of Drawer Layout functionality. I want to have an ability to use Drawer Layout as a navigational tool available throughout the app. To use the Drawer Layout, I am using the following in my activity…
6
votes
2 answers

Remove gap from navigation drawer layout

I have created an application that has a navigation view. when the application in fullscreen then I open that navigation-view that shows me the black overlay on top of navigation-view and also shows me the gap between the bottom of the screen and…
Bharat Vankar
  • 317
  • 2
  • 13
6
votes
2 answers

Unable to make DrawerLayout background to transparent in Samsung s8+

I am using DrawerLayout in my application. I am using NavigationView for the contents of the navigation drawer and setting its background to transparent using below code snip.
Amit Yadav
  • 32,664
  • 6
  • 42
  • 57
6
votes
5 answers

DrawerLayout with NavigationView - not showing ripple effect on click

I have a problem with obtaining on-click effect visible at my drawer. I have activity xml layout as follows:
6
votes
2 answers

Open second drawerlayout as a sub drawerlayout over the first

Android Studio 2.1.3 I have this design I am trying to follow. On the first drawerlayout I have a setttings options. When the user clicks, it will open a second drawerlayout like this below. The user can get back to the first by clicking on the…
ant2009
  • 27,094
  • 154
  • 411
  • 609
6
votes
3 answers

android.support.v7 Toolbar & DrawerLayout- how to hide Hamburger icon

I am implementing Toolbar along and Navigation drawer.I am customized my tool bar with my own views.I have my own menu(Hamburger) icon in my toolbar to open navigation drawer and I am showing badge count on my menu icon(Hamburger).So i would like to…
6
votes
5 answers

How to make a full-screen DrawerLayout in Android?

Essentially, I need an "options" menu that can be accessed by swiping the screen left to right (or clicking on the options button in the left top corner of the screen). I also need it to cover the screen, but not fully replace it (it needs to be…
Orlando Bloom
  • 109
  • 4
  • 10
6
votes
1 answer

Disabling right drawer only on specific fragment

I have Activity with DrawerLayout (which contains left and right drawer). I was wondering if I could disable right drawer from specific fragments. I've read about mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED), but it would…
Jacek Kwiecień
  • 12,397
  • 20
  • 85
  • 157
6
votes
3 answers

DrawerLayout with HorizontalScrollView into content menu

my question is simple. Can I use an HorizontalScrollView inside the content menu of a DrawerLayout? My DrawerLayout looks like this:
David Martinelli
  • 233
  • 6
  • 16
6
votes
1 answer

How to create DrawerLayout programmatically

I would like to translate this xml to java in my main activity, the output is navigation drawer. I need help only in this part, I finished the remaining parts.
user289175
  • 437
  • 1
  • 6
  • 11
6
votes
2 answers

Toggling DrawerLockMode of Android Navigation Drawer on rotation change.

I am following this post http://derekrwoods.com/2013/09/creating-a-static-navigation-drawer-in-android/ I want drawer to be opened when in landscape mode. Here is my onCreate function. @Override protected void onCreate(Bundle bundle) { …
Apurv Gupta
  • 870
  • 7
  • 14