UI Customization

Overview 

Modifier and TypeMethod and Description

com.cardinalcommerce.shared.

userinterfaces.ButtonCustomization

getButtonCustomization(ButtonType buttonType)
Gets button customization

com.cardinalcommerce.shared.

userinterfaces.ButtonCustomization

getButtonCustomization(String buttonType)
Gets button customization

com.cardinalcommerce.shared.

userinterfaces.LabelCustomization

getLabelCustomization()
Gets label customization

com.cardinalcommerce.shared.

userinterfaces.TextBoxCustomization

getTextBoxCustomization()
Gets text box customization

com.cardinalcommerce.shared.

userinterfaces.ToolbarCustomization

getToolbarCustomization()
Gets toolbar customization
voidsetButtonCustomization(ButtonCustomization buttonCustomization,ButtonType buttonType)
Sets button customization
voidsetButtonCustomization(ButtonCustomization buttonCustomization, java.lang.String buttonType)
Sets button customization
voidsetLabelCustomization(LabelCustomization labelCustomization)
Sets label customization
voidsetTextBoxCustomization(TextBoxCustomization textBoxCustomization)
Sets text box customization
voidsetToolbarCustomization(ToolbarCustomization toolbarCustomization)
Sets toolbar customization

Customization

Modifier and TypeMethod and Description
java.lang.StringgetTextColor()
Gets text color
java.lang.StringgetTextFontName()
Gets text font name
intgetTextFontSize()
Gets text font size
voidsetTextColor(java.lang.String textColor)
Sets text color
voidsetTextFontName(java.lang.String textFontName)
Sets text font name
voidsetTextFontSize(int textFontSize)
Sets text font size

ButtonCustomization

Methods Inherited from Customization

getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize
Modifier and TypeMethod and Description
java.lang.StringgetBackgroundColor()
This method shall return the background color of the button
intgetCornerRadius()
The getCornerRadius method shall return the radius of the button corners
voidsetBackgroundColor(java.lang.String hexColorCode)
Sets background color
voidsetCornerRadius(int cornerRadius)
Sets corner radius

LabelCustomization

Methods Inherited from Customization

getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize
Modifier and TypeMethod and Description
java.lang.StringgetHeadingTextColor()
Gets heading text color
java.lang.StringgetHeadingTextFontName()
Gets heading text font name.
intgetHeadingTextFontSize()
Gets heading text font size
voidsetHeadingTextColor(java.lang.String hexColorCode)
Sets the background color
voidsetHeadingTextFontName(java.lang.String fontName)
Sets the font type of the heading label text
voidsetHeadingTextFontSize(int fontSize)
Sets the font size of the heading label text.

TextBoxCustomization

Methods Inherited from Customization

getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize
Modifier and TypeMethod and Description
java.lang.StringgetBackgroundColor()
Gets background color
java.lang.StringgetButtonText()
Gets button text
java.lang.StringgetHeaderText()
Gets header text
voidsetBackgroundColor(java.lang.String hexColorCode)
Sets the background color for the toolbar
voidsetButtonText(java.lang.String buttonText)
Sets button text
voidsetHeaderText(java.lang.String headerText)
Sets header text

ToolbarCustomization

Methods Inherited from Customization

getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize
Modifier and TypeMethod and Description
java.lang.StringgetBorderColor()
Gets border color
intgetBorderWidth()
Gets border width
intgetCornerRadius()
Gets corner radius
voidsetBorderColor(java.lang.String hexColorCode)
Sets the background color for the toolbar
voidsetBorderWidth(int borderWidth)
Sets border width
voidsetCornerRadius(int cornerRadius)
Sets corner radius

Sample Code 

Sample Code Java
//Verify Button Customization
ButtonCustomization verifyButton = new ButtonCustomization();
verifyButton.setTextColor("#ffffff");
verifyButton.setBackgroundColor("#5585a2");
verifyButton.setTextFontName("font/amaticsc.ttf");
verifyButton.setCornerRadius(1);
verifyButton.setTextFontSize(16);
//Resend Button Customization
ButtonCustomization resendButton = new ButtonCustomization();
resendButton.setTextColor("#ffffff");
resendButton.setBackgroundColor("#5585a2");
resendButton.setTextFontName("font/amaticsc.ttf");
resendButton.setCornerRadius(1);
resendButton.setTextFontSize(16);

//Toolbar Customization
ToolbarCustomization toolbarCustomization = new ToolbarCustomization();
toolbarCustomization.setBackgroundColor("#003759");
toolbarCustomization.setButtonText("CANCEL");
toolbarCustomization.setHeaderText("DEMO CHECKOUT");
toolbarCustomization.setTextColor("#ffffff");
toolbarCustomization.setTextFontName("font/amaticsc.ttf");
toolbarCustomization.setTextFontSize(20);

//Textbox Customization
TextBoxCustomization textBoxCustomization = new TextBoxCustomization();
textBoxCustomization.setBorderColor("#000000");
textBoxCustomization.setBorderWidth(5);
textBoxCustomization.setCornerRadius(1);
textBoxCustomization.setTextColor("#00ff2a");
textBoxCustomization.setTextFontName("font/amaticsc.ttf");
textBoxCustomization.setTextFontSize(25);

//Label Customization
LabelCustomization labelCustomization = new LabelCustomization();
labelCustomization.setHeadingTextColor("#660000");
labelCustomization.setHeadingTextFontName("font/amaticsc.ttf");
labelCustomization.setHeadingTextFontSize(35);
labelCustomization.setTextColor("#000000");
labelCustomization.setTextFontName("font/amaticsc.ttf");
labelCustomization.setTextFontSize(15);

uiCustomization.setButtonCustomization(verifyButton, ButtonType.VERIFY);
uiCustomization.setButtonCustomization(resendButton, ButtonType.RESEND);
uiCustomization.setToolbarCustomization(toolbarCustomization);
uiCustomization.setTextBoxCustomization(textBoxCustomization);
uiCustomization.setLabelCustomization(labelCustomization);
Sample Code Kotlin
//Verify Button Customization
val verifyButton = ButtonCustomization()
verifyButton.textColor = "#ffffff"
verifyButton.backgroundColor = "#5585a2"
verifyButton.textFontName = "font/amaticsc.ttf"
verifyButton.cornerRadius = 1
verifyButton.textFontSize = 16

//Resend Button Customization
val resendButton = ButtonCustomization()
resendButton.textColor = "#ffffff"
resendButton.backgroundColor = "#5585a2"
resendButton.textFontName = "font/amaticsc.ttf"
resendButton.cornerRadius = 1
resendButton.textFontSize = 16

//Toolbar Customization
val toolbarCustomization = ToolbarCustomization()
toolbarCustomization.backgroundColor = "#003759"
toolbarCustomization.buttonText = "CANCEL"
toolbarCustomization.headerText = "DEMO CHECKOUT"
toolbarCustomization.textColor = "#ffffff"
toolbarCustomization.textFontName = "font/amaticsc.ttf"
toolbarCustomization.textFontSize = 20

//Textbox Customization
val textBoxCustomization = TextBoxCustomization()
textBoxCustomization.borderColor = "#000000"
textBoxCustomization.borderWidth = 5
textBoxCustomization.cornerRadius = 1
textBoxCustomization.textColor = "#00ff2a"
textBoxCustomization.textFontName = "font/amaticsc.ttf"
textBoxCustomization.textFontSize = 25

//Label Customization
val labelCustomization = LabelCustomization()
labelCustomization.headingTextColor = "#660000"
labelCustomization.headingTextFontName = "font/amaticsc.ttf"
labelCustomization.headingTextFontSize = 35
labelCustomization.textColor = "#000000"
labelCustomization.textFontName = "font/amaticsc.ttf"
labelCustomization.textFontSize = 15

uiCustomization.setButtonCustomization(verifyButton, ButtonType.VERIFY)
uiCustomization.setButtonCustomization(resendButton, ButtonType.RESEND)
uiCustomization.toolbarCustomization = toolbarCustomization
uiCustomization.textBoxCustomization = textBoxCustomization
uiCustomization.labelCustomization = labelCustomization

Fonts have to be added to the application and the path should be provided in the UI customization

Sample Screenshots