1
  1. I want Open like in image from right to left
  2. Here is my code where can i make change to open from right to left.

<FrameLayout
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</FrameLayout>

<ListView
    android:id="@+id/drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="#111"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp" />

Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
user2000244
  • 111
  • 2
  • 5

2 Answers2

0

In your main layout set your ListView gravity to end: Use android:layout_gravity="end"

0

layout:

    <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/activity_messages"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <!-- The main content view -->
            <FrameLayout
                android:id="@+id/activity_messages_content"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
            <!-- The navigation drawer -->
            <FrameLayout
                android:id="@+id/activity_messages_drawer"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="end"
                android:choiceMode="singleChoice"
                android:divider="@android:color/transparent"
                android:dividerHeight="0dp"
                android:background="@drawable/bg_background_gradient"/>
        </android.support.v4.widget.DrawerLayout>

in activity :

mLayout = (DrawerLayout)findViewById(R.id.activity_messages);
    mLayout.openDrawer(Gravity.RIGHT);
Rémy
  • 313
  • 3
  • 17