1

I am using SimonVT's MenuDrawer library (https://github.com/SimonVT/android-menudrawer) and have followed his Fragments sample in his code. Everything is working great, however in the fragments sample the menu appears on the entire left side of the screen (top to bottom) which goes thru/over the ActionBar. I am looking to have the Menu Drawer appear below the ActionBar at all times so the ActionBar stays in place. I have tried both properties OVERLAY and BEHIND but both take over the entire left side of the screen.

This is NOT what I want - http://i102.photobucket.com/albums/m91/saucergumshoe/MenuDrawerFragmentExampleMenuOverActionBar_zpsda4664f1.jpg

This is what I want, you can see the menu is below the ActionBar - http://i102.photobucket.com/albums/m91/saucergumshoe/MenuDrawerLeftOverlayExampleMenuUnderActionBar_zps7a20baa9.jpg

I am fairly new to Android so maybe I am making a silly mistake?

Here are the main settings on the Drawer:

mMenuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY, getDrawerPosition(), getDragMode());
    mMenuDrawer.setTouchMode(MenuDrawer.TOUCH_MODE_FULLSCREEN);
    mMenuDrawer.setSlideDrawable(R.drawable.ic_drawer);
    mMenuDrawer.setDrawerIndicatorEnabled(true);
Chris Smith
  • 688
  • 8
  • 20

2 Answers2

1

Set the drag mode to MENU_DRAG_CONTENT

mMenuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY, getDrawerPosition(), MenuDrawer.MENU_DRAG_CONTENT);
Maxime Lorant
  • 34,607
  • 19
  • 87
  • 97
littleibex
  • 1,705
  • 2
  • 14
  • 35
0

What I can suggest you, is to use the official NavigationDrawer from Google as explained at https://developer.android.com/design/patterns/navigation-drawer.html.

There's also a link to a tutorial with sample code: https://developer.android.com/training/implementing-navigation/nav-drawer.html. You can follow it to understand how to create a correct drawer and you can also download the source code as well.

This is the official component provided by Google and it behaves exactly as you asked in your question and like all the Google apps (and many others).

fasteque
  • 4,309
  • 8
  • 38
  • 50
  • 1
    Thanks for your thoughts. I am using MenuDrawer and not NavigationDrawer because I want the user to swipe right anywhere on the screen and bring up the menu. From my research on NavigationDrawer, it requires they swipe from the edge of the screen unless you manually increase the margin but that interferes with the pager widget which I'm also using. See http://stackoverflow.com/q/16583395/194872. I know it seems minor but the users I've tested with forget they need to swipe from the edge and get frustrated. – Chris Smith Apr 17 '14 at 13:50
  • What's the issue with the NavigationDrawer? Because apps like Google Play Store or StackExchange have both the NavigationDrawer and the ViewPager. – fasteque Apr 17 '14 at 13:56