Appearance and Strings

WirexAppearance, icons, copy and sizing for the Android SDK's reveal, collect, 3DS and Google Pay surfaces.

Before You Start

Read the following guides before proceeding:

GuideWhy
Android SDKSurfaces, isolation model and flows

Overview

Every surface takes an appearance object and a strings object. The SDK ships no copy — your app supplies
every word the views draw. One WirexAppearance styles Reveal, Collect and 3-D Secure; the wallet checkout
takes CSS variables.


Card Surfaces

val appearance = WirexAppearance(
    mode = WirexThemeMode.DARK,
    colorTextOverride = Color.WHITE,
    colorFocusOverride = Color.parseColor("#5753EA"),
    fontSizeBaseDp = 17f,
    borderRadiusDp = 12f,
)

fun apply(row: WirexRevealFieldView, form: WirexCollectForm) {
    row.setAppearance(appearance); row.setStrings(revealStrings)
    form.apply(appearance); form.apply(collectStrings)
}

WirexAppearance is a data class with every parameter defaulted. Colours are ARGB ints; sizes are dp.

GroupParameters
Modemode: LIGHT, DARK
ColourscolorTextOverride, colorLabelOverride, colorPlaceholderOverride, colorErrorOverride, colorFocusOverride, colorBackgroundOverride, colorBorderOverride, surfaceColorOverride
Typographytypeface, fontSizeBaseDp, fontSizeLabelDp, lineHeightBaseDp, lineHeightLabelDp, fontWeightBaseBold, fontWeightLabelBold
GeometryborderRadiusDp, borderWidthDp, spacingUnitDp, paddingHorizontalDp, paddingVerticalDp, spacingLabelDp, spacingErrorDp, iconSizeDp, controlMinHeightDp

WirexAppearanceTokens.appearance(tokens, mode) builds a WirexAppearance from a token map that uses the
Web SDK token names, so one token document can style both.

Icons are optional Drawables:

TypeConstructor
RevealWirexRevealIcons(copy, copied)
CollectWirexCollectIcons(visa, mastercard)
3-D SecureWirexThreeDSIcons(close)

Strings

val revealStrings = WirexRevealStrings(
    fieldLabels = mapOf(WirexRevealField.PAN to "Card number", WirexRevealField.CVV to "CVV"),
    maskedSegmentGlyph = "*", copy = "Copy", copied = "Copied",
)

val collectStrings = WirexCollectStrings(
    fieldLabels = mapOf(WirexCollectField.NUMBER to "Card number"),
    error = { field, reason ->
        when (reason) {
            WirexCollectFieldError.INCOMPLETE -> "${field.defaultLabel} is incomplete"
            WirexCollectFieldError.INVALID -> "Check the ${field.defaultLabel.lowercase()}"
            WirexCollectFieldError.EXPIRED -> "This card has expired"
        }
    },
)
TypeContents
WirexRevealStringsfieldLabels, maskedPlaceholder (plain fields), maskedSegmentGlyph (every PIN cell while masked, default "*"), copy, copied
WirexCollectStringsLabels, placeholders, an error lambda per field and a brandName lambda. fromJson accepts the Web SDK's JSON shape
WirexThreeDSStringsWirexThreeDSStrings(title, close, loading)

Google Pay Checkout

val walletAppearance = WirexWalletAppearance(theme = WirexWalletAppearance.Theme.DARK, variables = mapOf("--wx-accent" to "#5753EA"))
val walletButtons = WirexWalletButtons(googlePay = WirexWalletButtons.GooglePay(
    color = SpecWalletGooglePayButtonColor.BLACK, type = SpecWalletGooglePayButtonType.PAY))
val walletBranding = WirexWalletBranding(logo = WirexWalletLogo.Hidden, processingDisclosurePartnerName = "Acme")
TypeDescription
WirexWalletAppearance(theme, variables)CSS variables passed to the checkout
WirexWalletBranding(logo, processingDisclosurePartnerName, privacyUrl)Logo, processing disclosure, privacy URL
WirexWalletButtons(googlePay)Google Pay button color: BLACK, WHITE; type: PLAIN, PAY, BUY
stringsMap<SpecWalletStringKey, String> overriding the 11 labels of the checkout

Sizing

SurfaceHeight source
Reveal rowWRAP_CONTENT or WirexRevealFieldView.naturalHeightPx(widthPx)
Collect formWRAP_CONTENT or WirexCollectForm.naturalHeightPx(widthPx)
Google Pay checkoutNaturalHeight event

Apply the measured height instead of hardcoding it. A box shorter than the content clips the value.


Did this page help you?