0

In apps like Google+ or Facebook, you can tap on the upper right icon on the actionbar and the content below the actionbar slides to the left while a menu to the right of the content slides in, like this:

Google+ Left-to-Right Sliding menu

How is this done? Is there some built-in class/widget I can add? I don't want just a menu that pops up but slides in while the content slides out.

Here is a post that addresses this but it's 2 years old: Facebook Slider Menu

Maybe Google added this as a built-in feature since then like they did with the Navigation Drawwer?

Community
  • 1
  • 1
Johann
  • 27,536
  • 39
  • 165
  • 279

2 Answers2

2

It's called Navigation Drawer and it is a built-in option in Android. Please visit: Navigation Drawer | Android Developers

EDIT (by AndroidDev)

Here is how a dual navigation drawer is implemented: DrawerLayout Double Drawer (Left and Right Drawers simultaneously)

Community
  • 1
  • 1
MrByte
  • 1,083
  • 2
  • 11
  • 21
  • I am familiar with the Navigation Drawer but I have only seen it used from left-to-right where an icon in the top left corner of the actionbar is tapped. Also, the content stays fixed with when the Navigation Drawer slides out and the Navigation Drawer is overlayed on the content. So are you saying that the Navigation Drawer can be used on the right side and slides the content out of the way by setting some different properties? – Johann Jul 26 '14 at 10:25
  • You can set it from the right, this question was already asked here: http://stackoverflow.com/questions/18547277/how-to-set-navigation-drawer-to-be-opened-from-right-to-left – MrByte Jul 26 '14 at 10:43
  • But all these examples only show a single Navigation Drawer. I want a navigation drawer on the left and a slideout menu on the right like Google+ and Facebook, yet the docs seem to only indicate that you can have one navigation drawer, so I assume the slideout menu is something different. – Johann Jul 26 '14 at 10:48
0

You can also take a look at the open-source SlidingMenu library, that is used by an impressive list of apps. It should allow you to achieve the customizations you want.

There's also a Play Store Demo app called SlidingMenu Demo you can try.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
  • This seems to be outdated. Sure it does nice sliding, but the code is 2 years old and Google has since incorporated the Navigation Drawer into Android. So maybe the Navigation Drawer can also be used for sliding menus? Seems kind of logical. Furthermore, this UI pattern goes against the design pattern expressed by Android where the ActionBar is suppose to remain visible even when the menus slide out. – Johann Jul 26 '14 at 10:40
  • I have used this SlidingMenu library in one of my apps since I needed backward compatibility. This library is not outdated and works pretty well. You can see many apps using this library, like LinkedIn for example. – MrByte Jul 26 '14 at 10:46