public static int getNavigationBarHeight ( Context context ) { Resources resources = context . getResources ( ) ; int id = resources . getIdentifier ( context . getResources ( ) . getConfiguration ( ) . orientation == Configuration . ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_height_landscape" , "dimen" , "android" ) ; if ( id > 0 ) { return resources . getDimensionPixelSize ( id ) ; } return 0 ; }
helper to calculate the navigationBar height