Customize the Checkout Screens

We prepared two ready to use styles for checkout screens. You can define your own appearance from one of the default themes and apply the attributes you want to customize.

Todo Java Script

iOS

The Checkout project provides two ready to use styles:
  • Light theme – default (OPPCheckoutThemeStyleLight)
  • Dark theme (OPPCheckoutThemeStyleDark)

iOS Styles

You can set one of the default themes and override some properties:

Todo Java Script

iOS Properties

iOS Properties

iOS Properties

Todo Java Script

See below the list of properties you can customize and how they change the checkout UI:

Attribute NameTypeDescription
primaryBackgroundColorUIColorBackground color for any views in this theme
primaryForegroundColorUIColorText color for any important labels in a view
textFieldBackroundColorUIColorBackground color of text fields
textFieldTextColorUIColorInput field text color
textFieldPlaceholderColorUIColorPlaceholder color for text fields
confirmationButtonColorUIColorThe color of the confirmation buttons
confirmationButtonTextColorUIColorText color for confirmation buttons
sectionBackgroundColorUIColorBackground color of section
sectionTextColorUIColorText color of section title
cellHighlightedBackgroundColorUIColorHighlighted background color for cell in the table view – payment brands list
cellHighlightedTextColorUIColorText label highlighted color
cellTintColorUIColorTint color for cell in the table view
separatorColorUIColorColor for separator lines
paymentBrandIconBackgroundColorUIColorBackground color for payment brand icons
paymentBrandIconBorderColorUIColorBorder color for payment brand icons
storedPaymentMethodIconBackgroundColorUIColorBackground color for stored payment method icons
storedPaymentMethodIconBorderColorUIColorBorder color for stored payment method icons
errorColorUIColorColor for rendering any error messages or views
primaryFontUIFontText font for any important labels in a view
secondaryFontUIFontText font for any other labels in a view
confirmationButtonFontUIFontText font for confirmation button
sectionFontFont of section titleText font for cell on the table view
cellTextFontUIFontText font for cell on the table view
errorFontUIFontText font for rendering any error messages
activityIndicatorPrimaryStyleUIActivityIndicatorViewStyleIndicator view processing style
navigationBarTintColorUIColorNavigation bar tint color
navigationBarBackgroundColorUIColorNavigation bar background color
navigationBarTextAttributesNSDictionaryText attributes for navigation bar title
navigationItemTextAttributesNSDictionaryText attributes for navigation bar item titles
cancelBarButtonTextNSStringCustom text for the right bar button in the navigation bar
Localized text is expected
SDK is NOT localizing this text. Default value is “Cancel”
cancelBarButtonImageUIImageCustom image for the right bar button in the navigation bar
If image is not set, text button is shown (cancelBarButtonText)

Note: This section is for the Android content the buttons to toggle between each systems will be added at an other time

Android

The Checkout project uses styles to customize UI. A style is a collection of properties that specify the look and format for a View or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that is separate from the XML that specifies the layout.

The Checkout project provides two ready to use styles:

  • Light Theme (Theme.Checkout.Light)
  • Dark Theme (Theme.Checkout.Dark)

Android Styles

You can customize these styles or create your own style based on Checkout style. To apply the style declare it in the AndroidManifest.xml file within Checkout activity tag:
<activity
    android:name="com.oppwa.mobile.connect.checkout.dialog.CheckoutActivity"
    android:theme="@style/Theme.Checkout.Light"
    android:windowSoftInputMode="adjustPan"/>

You can quickly customize the checkout theme by overriding the checkout_color_accent. Simply add it to your color resources, for example:

<resources>
    <color name="checkout_color_accent">#29b6f6</color>
</resources>

Android Checkout Accent Color

For deeper customization you can override any attributes from the predefined styles. See below the list of properties you can customize and how they change the checkout UI:

Attribute NameTypeDescription
cancelButtonDrawablereferenceThe image of cancel button
listDisclosureDrawablereferenceThe image of list disclosure
listMarkDrawablereferenceThe mark of selected list item
cameraDrawablereferenceThe image of camera button on the card payment info form
cancelButtonTintColorcolorThe color of cancel button drawable
listDisclosureTintColorcolorThe color of list disclosure drawable
listMarkTintColorcolorThe color of list item mark drawable
cameraTintColorcolorThe color of camera icon drawable
headerBackgroundcolor|referenceThe header background, you can use color or image for this
windowBackgroundcolor|referenceThe window background, you can use color or image for this
checkoutTextViewStylereferenceThe base style of checkout text view
checkoutHelperTextViewStylereferenceThe style of helper text view
checkoutSectionTitleTextViewStylereferenceThe style of payment list section title. For example “Stored Payment Methods”
checkoutProgressTextViewStylereferenceThe style of progress text view
checkoutEditTextStylereferenceThe base style of checkout edit text
checkoutTokenImageViewStylereferenceThe style of payment token icon image view
checkoutMethodImageViewStylereferenceThe style of payment brand icon image view
checkoutButtonStylereferenceThe style of pay button
checkoutListViewStylereferenceThe style of list view
paymentMethodListItemSelectorreferenceThe selector for the payment methods list
checkoutProgressBarStylereferenceThe style of progress bar
typefacestringThe name of the .ttf font file placed in assets/fonts directory
This name does not include file extension
You can add this attribute to any view style

Android Custom Attributes

Android Custom Attributes

Android Custom Attributes

Here is an example of the custom style based on Checkout.Light style. You can add it in your /res/values/styles.xml file
<style name="NewCheckoutTheme" parent="Theme.Checkout.Light">
    <item name="headerBackground">@color/checkout_header_color</item>

    <item name="cancelButtonTintColor">@android:color/black</item>
    <item name="listMarkTintColor">@color/accent_color</item>
    <item name="cameraTintColor">@color/accent_color</item>
    <item name="checkboxButtonTintColor">@color/accent_color</item>

    <item name="paymentMethodListItemSelector">@drawable/checkout_list_item_selector</item>

    <item name="checkoutButtonStyle">@style/NewCheckoutTheme.Button</item>
</style>

<style name="NewCheckoutTheme.Button" parent="Checkout.Button.Light">
    <item name="android:background">@color/accent_color</item>
</style>