private void setHeaderHeight ( int height ) { if ( mAccountHeaderContainer != null ) { ViewGroup . LayoutParams params = mAccountHeaderContainer . getLayoutParams ( ) ; if ( params != null ) { params . height = height ; mAccountHeaderContainer . setLayoutParams ( params ) ; } View accountHeader = mAccountHeaderContainer . findViewById ( R . id . material_drawer_account_header ) ; if ( accountHeader != null ) { // TODO why is this null? params = accountHeader . getLayoutParams ( ) ; if ( params != null ) { params . height = height ; accountHeader . setLayoutParams ( params ) ; } } View accountHeaderBackground = mAccountHeaderContainer . findViewById ( R . id . material_drawer_account_header_background ) ; if ( accountHeaderBackground != null ) { params = accountHeaderBackground . getLayoutParams ( ) ; params . height = height ; accountHeaderBackground . setLayoutParams ( params ) ; } } }
helper method to set the height for the header!