I have implemented drawerlayout which slides from the right but it does not shift the activity the right like facebook does (See below image). How do I push the current acti
This is really helpful. Put this snippet in your MainActivity.java
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
containerFrame.setTranslationX(slideOffset * drawerView.getWidth());
drawerLayout.bringChildToFront(drawerView);
drawerLayout.requestLayout();
//below line used to remove shadow of drawer
drawerLayout.setScrimColor(Color.TRANSPARENT);
}//this method helps you to aside menu drawer
};