urbanairship-core/src/main/java/com/urbanairship/iam/view/InAppViewUtils.java
public static void applyButtonInfo(@NonNull Button button, @NonNull ButtonInfo buttonInfo, @BorderRadius.BorderRadiusFlag int borderRadiusFlag) {
        applyTextInfo(button, buttonInfo.getLabel());

        int textColor = buttonInfo.getLabel().getColor() == null ? button.getCurrentTextColor() : buttonInfo.getLabel().getColor();
        int backgroundColor = buttonInfo.getBackgroundColor() == null ? Color.TRANSPARENT : buttonInfo.getBackgroundColor();
        int pressedColor = ColorUtils.setAlphaComponent(textColor, Math.round(Color.alpha(textColor) * PRESSED_ALPHA_PERCENT));
        int strokeColor = buttonInfo.getBorderColor() == null ? backgroundColor : buttonInfo.getBorderColor();

        float borderRadius = buttonInfo.getBorderRadius() == null ? DEFAULT_BORDER_RADIUS : buttonInfo.getBorderRadius();

        Drawable background = BackgroundDrawableBuilder.newBuilder(button.getContext())
                                                       .setBackgroundColor(backgroundColor)
                                                       .setBorderRadius(borderRadius, borderRadiusFlag)
                                                       .setPressedColor(pressedColor)
                                                       .setStrokeColor(strokeColor)
                                                       .setStrokeWidth(DEFAULT_STROKE_WIDTH_DPS)
                                                       .build();

        ViewCompat.setBackground(button, background);
    }
/**
     * Applies button info to a button.
     *
     * @param button The button view.
     * @param buttonInfo The button info.
     * @param borderRadiusFlag The border radius flag.
     */
Applies button info to a button.
@param button The button view.
@param buttonInfo The button info.
@param borderRadiusFlag The border radius flag.
Applies button info to a button . @param button The button view . @param buttonInfo The button info . @param borderRadiusFlag The border radius flag .
public static void applyButtonInfo(@NonNull Button button, @NonNull ButtonInfo buttonInfo, @BorderRadius.BorderRadiusFlag int borderRadiusFlag) {
        applyTextInfo(button, buttonInfo.getLabel());
        int textColor = buttonInfo.getLabel().getColor() == null ? button.getCurrentTextColor() : buttonInfo.getLabel().getColor();
        int backgroundColor = buttonInfo.getBackgroundColor() == null ? Color.TRANSPARENT : buttonInfo.getBackgroundColor();
        int pressedColor = ColorUtils.setAlphaComponent(textColor, Math.round(Color.alpha(textColor) * PRESSED_ALPHA_PERCENT));
        int strokeColor = buttonInfo.getBorderColor() == null ? backgroundColor : buttonInfo.getBorderColor();
        float borderRadius = buttonInfo.getBorderRadius() == null ? DEFAULT_BORDER_RADIUS : buttonInfo.getBorderRadius();
        Drawable background = BackgroundDrawableBuilder.newBuilder(button.getContext())
                                                       .setBackgroundColor(backgroundColor)
                                                       .setBorderRadius(borderRadius, borderRadiusFlag)
                                                       .setPressedColor(pressedColor)
                                                       .setStrokeColor(strokeColor)
                                                       .setStrokeWidth(DEFAULT_STROKE_WIDTH_DPS)
                                                       .build();
        ViewCompat.setBackground(button, background);
    }
public static void applyButtonInfo ( @ NonNull Button button , @ NonNull ButtonInfo buttonInfo , @ BorderRadius . BorderRadiusFlag int borderRadiusFlag ) { applyTextInfo ( button , buttonInfo . getLabel ( ) ) ; int textColor = buttonInfo . getLabel ( ) . getColor ( ) == null ? button . getCurrentTextColor ( ) : buttonInfo . getLabel ( ) . getColor ( ) ; int backgroundColor = buttonInfo . getBackgroundColor ( ) == null ? Color . TRANSPARENT : buttonInfo . getBackgroundColor ( ) ; int pressedColor = ColorUtils . setAlphaComponent ( textColor , Math . round ( Color . alpha ( textColor ) * PRESSED_ALPHA_PERCENT ) ) ; int strokeColor = buttonInfo . getBorderColor ( ) == null ? backgroundColor : buttonInfo . getBorderColor ( ) ; float borderRadius = buttonInfo . getBorderRadius ( ) == null ? DEFAULT_BORDER_RADIUS : buttonInfo . getBorderRadius ( ) ; Drawable background = BackgroundDrawableBuilder . newBuilder ( button . getContext ( ) ) . setBackgroundColor ( backgroundColor ) . setBorderRadius ( borderRadius , borderRadiusFlag ) . setPressedColor ( pressedColor ) . setStrokeColor ( strokeColor ) . setStrokeWidth ( DEFAULT_STROKE_WIDTH_DPS ) . build ( ) ; ViewCompat . setBackground ( button , background ) ; }
Applies button info to a button.
Applies button info to a button .