-1

I'm working on this project, and i need to create a double drawer app, it's possible to modify the navigation drawer so it can work both sides? or do I created a double drawer without using the navigation drawer.

Surya Prakash Kushawah
  • 3,185
  • 1
  • 22
  • 42

3 Answers3

1

try Sliding menu lib

SlidingMenu

You will have to implement the button feature yourself but it shouldn't be too hard!

EDIT:

An example:

SlidingMenu menuS = new SlidingMenu(this);
menuS.setMode(SlidingMenu.LEFT_RIGHT);
menuS.setMenu(R.layout.slideout_list);
menuS.setSecondaryMenu(R.layout.slideout_list2);
As the code shows you need to set the mode to LEFT_RIGHT and must specify a layout for both the left menu (setMenu()) and the right menu (setSecondaryMenu()) along with the other options specifying menu size and shadows etc.
Surya Prakash Kushawah
  • 3,185
  • 1
  • 22
  • 42
0

If your navigation drawers needs to display different data (why would you display the same data from the right and the left?) like a navigation on the left and a search filter on the right. You'd better use 2 different drawers, each one with his own data / behaviour.

<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/content_main_activity"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_ad_list"
        app:menu="@menu/activity_main_navigation_menu"
        headerLayout="@layout/nav_header_ad_list"
        menu="@menu/activity_main_navigation_menu"
        tools:layout_gravity="start"
        />

    <android.support.design.widget.NavigationView
        android:id="@+id/activity_main_search_filter"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:layout_gravity="end"
        tools:layout_gravity="end"
        />

</android.support.v4.widget.DrawerLayout>
Vincent D.
  • 977
  • 7
  • 20
0

You have to combine some of the methodology. like you have to implement fragment in that navigation view portion in navigation drawer layout. second there is no way both drawer can be opened at same time so implement one fragment over there and on the basis of different click event open drawer layout with different gravity value (GravityCompat.START, GravityCompat.END). like from drawer button open drawer from left and from filter button open drawer from right and load different fragment view on the basis of that. I hope it will serve your purpose.

Wasim K. Memon
  • 5,979
  • 4
  • 40
  • 55