I have created an Android application, in that I want to open slide menu from right side and when drawer is open I want to slide the view like attached image.
Code:
<android.support.v4.widget.DrawerLayout
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start">
<android.support.design.widget.NavigationView
android:id="@+id/navigationView_Right_Home"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:fitsSystemWindows="true" />
</android.support.v4.widget.DrawerLayout>
For slide view I have used below code, but it's not working
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
View container = findViewById(R.id.ll);
float moveFactor = (slideOffset - drawerView.getWidth());
container.setTranslationX(moveFactor);
drawer.bringChildToFront(drawerView);
drawer.requestLayout();
}