I am trying to implement a two-drawer layout with the android v7 support library. I have a navigation drawer on the left (Gravity.START) side and a notification drawer on th
The above accepted answer not working for me but the below one does
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, 0); // this disables the animation
}
Since support v7 version 25.3.0, you can disable the animation
yourActionBarDrawerToggle.setDrawerSlideAnimationEnabled(false);
Along with handling onDrawerSlide
you need to handle both onDrawerOpened
and onDrawerClosed
:
@Override
public void onDrawerOpened(View drawerView, float slideOffset) {
// Make sure it was the navigation drawer
if(drawerView.equals(navigationDrawer)) {
super.onDrawerOpened(drawerView, slideOffset);
}
else {
// Do nothing
}
}
@Override
public void onDrawerClosed(View drawerView, float slideOffset) {
// Make sure it was the navigation drawer
if(drawerView.equals(navigationDrawer)) {
super.onDrawerClosed(drawerView, slideOffset);
}
else {
// Do nothing
}
}