Please anyone suggest me how to implement Navigation drawer swipe complete screen Of activity.
OR
Thanks in Advance.
***---------
Solution--------*:** I found the solution for this.
Use this lib it is easy to use and handle
Please anyone suggest me how to implement Navigation drawer swipe complete screen Of activity.
OR
Thanks in Advance.
***---------
Solution--------*:** I found the solution for this.
Use this lib it is easy to use and handle
You can try use this layout for drawer activity.
<?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"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="7dp"
>
<RelativeLayout
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</RelativeLayout>
<FrameLayout
android:id="@+id/drawer_holder"
android:layout_width="@dimen/drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
>
<ListView
android:id="@+id/drawer_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>
</android.support.v4.widget.DrawerLayout>
And add DrawerLayout.DrawerListener
to DrawerLayout
like this.
drawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() {
@Override
public void onDrawerSlide(View view, float slideOffset) {
drawerView.setX(drawerHolder.getWidth() * (1 - slideOffset));
contentLayout.setX(drawerHolder.getWidth() * slideOffset);
}
@Override
public void onDrawerOpened(View view) {
}
@Override
public void onDrawerClosed(View view) {
}
@Override
public void onDrawerStateChanged(int newState) {
}
});
And after adding listner put this code.
drawerLayout.closeDrawer(drawerHolder);
mainDrawerView.setX(0);
contentLayout.setX(0);
Hope that will help.