static Drawable bootstrapLabel ( Context context , BootstrapBrand bootstrapBrand , boolean rounded , float height ) { int cornerRadius = ( int ) DimenUtils . pixelsFromDpResource ( context , R . dimen . bootstrap_default_corner_radius ) ; GradientDrawable drawable = new GradientDrawable ( ) ; drawable . setColor ( bootstrapBrand . defaultFill ( context ) ) ; // corner radius should be half height if rounded as a "Pill" label drawable . setCornerRadius ( rounded ? height / 2 : cornerRadius ) ; return drawable ; }
Generates a Drawable for a Bootstrap Label background according to state parameters