I\'d like to create a full width navigation drawer. Setting layout_width to match_parent on @+id/left_drawer yields in width of about
A variant on Grogory's solution:
Instead of subclassing I call the following utility method right after I grab a reference to the drawer layout:
/**
* The specs tell that
*
* - Navigation Drawer should be at most 5*56dp wide on phones and 5*64dp wide on tablets.
* - Navigation Drawer should have right margin of 56dp on phones and 64dp on tablets.
*
* yet the minimum margin is hardcoded to be 64dp instead of 56dp. This fixes it.
*/
public static void fixMinDrawerMargin(DrawerLayout drawerLayout) {
try {
Field f = DrawerLayout.class.getDeclaredField("mMinDrawerMargin");
f.setAccessible(true);
f.set(drawerLayout, 0);
drawerLayout.requestLayout();
} catch (Exception e) {
e.printStackTrace();
}
}