public static int getOptimalDrawerWidth ( Context context ) { int possibleMinDrawerWidth = UIUtils . getScreenWidth ( context ) - UIUtils . getActionBarHeight ( context ) ; int maxDrawerWidth = context . getResources ( ) . getDimensionPixelSize ( R . dimen . material_drawer_width ) ; return Math . min ( possibleMinDrawerWidth , maxDrawerWidth ) ; }
helper to calculate the optimal drawer width