-1

Currently, I have navigation drawer on left that controls the fragment's navigation. I want to implement filter function and I want it to slide in from right-to-left like navigation drawer. How can I achieve such design like image below? TIA

enter image description here

JhesterMag
  • 71
  • 1
  • 9
  • have u check this https://stackoverflow.com/questions/18547277/how-to-set-navigation-drawer-to-be-opened-from-right-to-left – AskNilesh Jan 04 '19 at 10:20

2 Answers2

0
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

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

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="@dimen/nav_width"
        android:layout_height="match_parent"
        android:layout_gravity="right"
        android:fitsSystemWindows="true"
        app:itemTextAppearance="@style/menu_text_style"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/menu_drawer" />

</android.support.v4.widget.DrawerLayout>

You can do it easily by android:layout_gravity="right".

0
android:layout_gravity="end"

This will help you and also you have to set it in Activity Like

if (drawerLayout.isDrawerOpen(Gravity.RIGHT)) {
                drawerLayout.closeDrawer(Gravity.RIGHT);
            } else {
                drawerLayout.openDrawer(Gravity.RIGHT);
            }