I am trying to remove the Drawer shadow when navigation view opens. As suggested in many forums, i have used the below code to remove drawer shadow. But it seems to have no impact.Kindly help me find out where i am going wrong. I am actually trying to achieve the same effect, but when the drawer opens, there seems to be a line/shadow like effect at the end of the drawer.It doesnt look the same as the one in the link. Below is the screenshot of my app. As you can see, there seem to be a line/shadow like effect at the end of the navigation drawer. How can i remove it. I have highlighted the issue in red. my image
Moving and resizing DrawerLayout's content on sliding
drawer.setScrimColor(Color.TRANSPARENT);
drawer.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.END);
My XML
<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:background="@drawable/navmenu_gradient"
android:fitsSystemWindows="true"
tools:openDrawer="start"
>
<RelativeLayout android:id="@+id/holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="left"
app:theme="@style/NavigationDrawerStyle"
android:background="@drawable/navmenu_gradient"
app:itemTextColor="@drawable/drawer_item_color"
app:itemIconTint="@drawable/drawer_item_color"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.NavigationView"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
My OnDrawerSlide method
public void onDrawerSlide(View drawerView, float slideOffset) {
// Scale the View based on current slide offset
final float diffScaledOffset = slideOffset * (1 - END_SCALE);
final float offsetScale = 1 - diffScaledOffset;
contentView.setScaleX(offsetScale);
contentView.setScaleY(offsetScale);
// Translate the View, accounting for the scaled width
final float xOffset = drawerView.getWidth() * slideOffset;
final float xOffsetDiff = contentView.getWidth() * diffScaledOffset / 2;
final float xTranslation = xOffset - xOffsetDiff;
contentView.setTranslationX(xTranslation);
}