title: How to implement drawer menu open from right side
body: <p>I have created created one navigation drawer following <a href="http://www.android4devs.com/2015/06/navigation-view-material-design-support.html" rel="nofollow">this tutorial</a></p>
  
  <p>But what I need is , I need the same drawer menu open from right side . Anyone know how to achieve this?</p>
  
  <p>Following is my xml</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/drawer"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true"
  tools:context=".MainActivity"&gt;
  
  &lt;LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      &gt;
      &lt;include
          android:id="@+id/toolbar"
          layout="@layout/tool_bar"
      /&gt;
      &lt;FrameLayout
          android:id="@+id/frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
      &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  &lt;android.support.design.widget.NavigationView
      android:id="@+id/navigation_view"
      android:layout_height="match_parent"
      android:layout_width="wrap_content"
      android:layout_gravity="right"
      app:headerLayout="@layout/header"
      app:menu="@menu/drawer"
      /&gt;
  </code></pre>
  
  <p></p>
  
  <p>and in code</p>
  
  <pre><code>  // Initializing Drawer Layout and ActionBarToggle
      drawerLayout = (DrawerLayout) findViewById(R.id.drawer);
      ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.openDrawer, R.string.closeDrawer){
  
          @Override
          public void onDrawerClosed(View drawerView) {
              // Code here will be triggered once the drawer closes as we dont want anything to happen so we leave this blank
              super.onDrawerClosed(drawerView);
          }
  
          @Override
          public boolean onOptionsItemSelected(MenuItem item) {
              if (item != null &amp;&amp; item.getItemId() == android.R.id.home) {
                  if (drawerLayout.isDrawerOpen(Gravity.RIGHT)) {
                      drawerLayout.closeDrawer(Gravity.RIGHT);
                  } else {
                      drawerLayout.openDrawer(Gravity.RIGHT);
                  }
              }
              return false;
          }
  
          @Override
          public void onDrawerOpened(View drawerView) {
              // Code here will be triggered once the drawer open as we dont want anything to happen so we leave this blank
  
              super.onDrawerOpened(drawerView);
          }
  
      };
  </code></pre>