Search code examples
androidandroid-layoutdrawerlayouthamburger-menu

iOS hamburger menu in Android


Hi I saw this layout in my calendar and I would like to implement it in my application. It looks like common drawer layout, but instead of menu moving over the activity, activity moves to right and uncover menu beneath it. It is similar to hamburger menu in iOS.

menu layout image 1 menu layout image 2

Problem is, I'm not sure what am I actually looking for. Does it have some name in android or can I somehow modify drawer layout to look like this?


Solution

  • You can take a look at this tutorial: https://developer.android.com/training/implementing-navigation/nav-drawer.html

    If you want to achieve the effect of the main content sliding right with the drawer, you may use this callback: https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.DrawerListener.html#onDrawerSlide(android.view.View, float)

    In the implementation, you just need to adjust the translationX property of your main view group accordingly.