static Drawable bootstrapButton ( Context context , BootstrapBrand brand , int strokeWidth , int cornerRadius , ViewGroupPosition position , boolean showOutline , boolean rounded ) { GradientDrawable defaultGd = new GradientDrawable ( ) ; GradientDrawable activeGd = new GradientDrawable ( ) ; GradientDrawable disabledGd = new GradientDrawable ( ) ; defaultGd . setColor ( showOutline ? Color . TRANSPARENT : brand . defaultFill ( context ) ) ; activeGd . setColor ( showOutline ? brand . activeFill ( context ) : brand . activeFill ( context ) ) ; disabledGd . setColor ( showOutline ? Color . TRANSPARENT : brand . disabledFill ( context ) ) ; defaultGd . setStroke ( strokeWidth , brand . defaultEdge ( context ) ) ; activeGd . setStroke ( strokeWidth , brand . activeEdge ( context ) ) ; disabledGd . setStroke ( strokeWidth , brand . disabledEdge ( context ) ) ; if ( showOutline && brand instanceof DefaultBootstrapBrand ) { DefaultBootstrapBrand db = ( DefaultBootstrapBrand ) brand ; if ( db == DefaultBootstrapBrand . SECONDARY ) { int color = ColorUtils . resolveColor ( R . color . bootstrap_brand_secondary_border , context ) ; defaultGd . setStroke ( strokeWidth , color ) ; activeGd . setStroke ( strokeWidth , color ) ; disabledGd . setStroke ( strokeWidth , color ) ; } } setupDrawableCorners ( position , rounded , cornerRadius , defaultGd , activeGd , disabledGd ) ; return setupStateDrawable ( position , strokeWidth , defaultGd , activeGd , disabledGd ) ; }
Generates a background drawable for a Bootstrap Button