private int getMargin ( int gravity , int margin , int minimumMargin ) { switch ( gravity ) { case Gravity . CENTER : return ( margin == INVALID ) ? minimumMargin : margin ; default : return ( margin == INVALID ) ? 0 : margin ; } }
Get margins if provided or assign default values based on gravity