Challenge User Interface Customization Android
- Bharadwaj Reddy Sama (Unlicensed)
- Kayleigh LaSalle
- Shrey Bhagat
- Khaing Soe
Owned by Bharadwaj Reddy Sama (Unlicensed)
Overview
Modifier and Type | Method and Description |
---|---|
| getButtonCustomization(ButtonType buttonType) Gets button customization |
| getButtonCustomization(String buttonType) Gets button customization |
| getLabelCustomization() Gets label customization |
| getTextBoxCustomization() Gets text box customization |
| getToolbarCustomization() Gets toolbar customization |
void | setButtonCustomization(ButtonCustomization buttonCustomization,ButtonType buttonType) Sets button customization |
void | setButtonCustomization(ButtonCustomization buttonCustomization, java.lang.String buttonType) Sets button customization |
void | setLabelCustomization(LabelCustomization labelCustomization) Sets label customization |
void | setTextBoxCustomization(TextBoxCustomization textBoxCustomization) Sets text box customization |
void | setToolbarCustomization(ToolbarCustomization toolbarCustomization) Sets toolbar customization |
Customization
Modifier and Type | Method and Description |
---|---|
java.lang.String | getTextColor() Gets text color |
java.lang.String | getTextFontName() Gets text font name |
int | getTextFontSize() Gets text font size |
void | setTextColor(java.lang.String textColor) Sets text color |
void | setTextFontName(java.lang.String textFontName) Sets text font name |
void | setTextFontSize(int textFontSize) Sets text font size |
ButtonCustomization
Methods Inherited from Customization |
---|
getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize |
Modifier and Type | Method and Description |
---|---|
java.lang.String | getBackgroundColor() This method shall return the background color of the button |
int | getCornerRadius() The getCornerRadius method shall return the radius of the button corners |
void | setBackgroundColor(java.lang.String hexColorCode) Sets background color |
void | setCornerRadius(int cornerRadius) Sets corner radius |
LabelCustomization
Methods Inherited from Customization |
---|
getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize |
Modifier and Type | Method and Description |
---|---|
java.lang.String | getHeadingTextColor() Gets heading text color |
java.lang.String | getHeadingTextFontName() Gets heading text font name. |
int | getHeadingTextFontSize() Gets heading text font size |
void | setHeadingTextColor(java.lang.String hexColorCode) Sets the background color |
void | setHeadingTextFontName(java.lang.String fontName) Sets the font type of the heading label text |
void | setHeadingTextFontSize(int fontSize) Sets the font size of the heading label text. |
TextBoxCustomization
Methods Inherited from Customization |
---|
getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize |
Modifier and Type | Method and Description |
---|---|
java.lang.String | getBackgroundColor() Gets background color |
java.lang.String | getButtonText() Gets button text |
java.lang.String | getHeaderText() Gets header text |
void | setBackgroundColor(java.lang.String hexColorCode) Sets the background color for the toolbar |
void | setButtonText(java.lang.String buttonText) Sets button text |
void | setHeaderText(java.lang.String headerText) Sets header text |
ToolbarCustomization
Methods Inherited from Customization |
---|
getTextColor, getTextFontName, getTextFontSize, setTextColor, setTextFontName, setTextFontSize |
Modifier and Type | Method and Description |
---|---|
java.lang.String | getBorderColor() Gets border color |
int | getBorderWidth() Gets border width |
int | getCornerRadius() Gets corner radius |
void | setBorderColor(java.lang.String hexColorCode) Sets the background color for the toolbar |
void | setBorderWidth(int borderWidth) Sets border width |
void | setCornerRadius(int cornerRadius) Sets corner radius |
Sample Code
Sample Code Java Expand source
import com.cardinalcommerce.shared.models.enums.ButtonType; import com.cardinalcommerce.shared.userinterfaces.ButtonCustomization; import com.cardinalcommerce.shared.userinterfaces.LabelCustomization; import com.cardinalcommerce.shared.userinterfaces.TextBoxCustomization; import com.cardinalcommerce.shared.userinterfaces.ToolbarCustomization; import com.cardinalcommerce.shared.userinterfaces.UiCustomization; //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 uiCustomization = new UiCustomization(); uiCustomization.setButtonCustomization(verifyButton, ButtonType.VERIFY); uiCustomization.setButtonCustomization(resendButton, ButtonType.RESEND); uiCustomization.setToolbarCustomization(toolbarCustomization); uiCustomization.setTextBoxCustomization(textBoxCustomization); uiCustomization.setLabelCustomization(labelCustomization);
Sample Code Kotlin Expand source
import com.cardinalcommerce.shared.models.enums.ButtonType; import com.cardinalcommerce.shared.userinterfaces.ButtonCustomization; import com.cardinalcommerce.shared.userinterfaces.LabelCustomization; import com.cardinalcommerce.shared.userinterfaces.TextBoxCustomization; import com.cardinalcommerce.shared.userinterfaces.ToolbarCustomization; import com.cardinalcommerce.shared.userinterfaces.UiCustomization; //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 val uiCustomization = UiCustomization() 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