For the complete documentation index, see llms.txt. This page is also available as Markdown.

Ui Customization

Face Liveness Lite lets you adapt the liveness screen to your brand: colors, title, logo, close icon, font and the mask effect.

Pass a UiCustomization through CafLivenessConfig.uiCustomization. Every field is optional — anything you leave out keeps the default appearance, so you can customize only what you need.

Basic usage

val uiCustomization = UiCustomization(
    font = LivenessFont.ResFont(R.font.your_font),
    appBar = AppBarCustomization(
        title = "Identity check",
        titleColor = ContextCompat.getColor(context, R.color.white),
        color = ContextCompat.getColor(context, R.color.brand_navy),
        logoIcon = R.drawable.your_logo,
        closeButton = R.drawable.your_close_icon,
    ),
    mask = MaskCustomization(
        isBlurEnabled = true,
        color = ContextCompat.getColor(context, R.color.brand_navy),
    ),
    prompt = PromptCustomization(
        textColor = ContextCompat.getColor(context, R.color.white),
        backgroundColor = ContextCompat.getColor(context, R.color.brand_green),
        isRounded = true,
    ),
)

val config = CafLivenessConfig(
    mobileToken = mobileToken,
    personId = personId,
    uiCustomization = uiCustomization,
)

CafFaceLivenessLite.instance.startLiveness(context, config) { event ->
    // handle events
}

UiCustomization

The root object. Each group is optional and can be omitted.

Parameter
Type
Default
Description

font

LivenessFont?

null

Custom font applied to the title and the prompt text.

mask

MaskCustomization?

null

Appearance of the area around the face oval.

appBar

AppBarCustomization?

null

Title, colors, logo and close icon of the top bar.

prompt

PromptCustomization?

null

Appearance of the instruction box shown to the user.

AppBarCustomization

The bar at the top of the liveness screen.

Parameter
Type
Default
Description

title

String?

Empty

Title shown during the liveness scan.

titleColor

@ColorInt Int?

White

Color of the title text.

color

@ColorInt Int?

Transparent

Background color of the top bar.

logoIcon

@DrawableRes Int?

No logo

Logo displayed in the top bar.

closeButton

@DrawableRes Int?

Provider default (back arrow, white)

Icon of the button that closes the liveness screen.

MaskCustomization

The area outside the oval where the user positions their face.

Parameter
Type
Default
Description

isBlurEnabled

Boolean

true

Whether the blur and vignette effects are applied outside the oval. Set to false for a flat overlay.

color

@ColorInt Int?

Semi-transparent black

Color of the area outside the oval. Use a color with alpha to keep the camera preview partially visible.

PromptCustomization

The box that displays instructions to the user during the scan.

Parameter
Type
Default
Description

textColor

@ColorInt Int?

White

Color of the instruction text.

backgroundColor

@ColorInt Int?

Semi-transparent black

Background color of the instruction box.

isRounded

Boolean

true

Whether the instruction box has rounded corners.

LivenessFont

Applied to the title and the prompt text.

Option
Parameter
Description

LivenessFont.ResFont

@FontRes res: Int

Font from your app resources, for example R.font.your_font.

LivenessFont.PathFont

path: String

Font loaded from a file path.

Colors, icons and fonts

  • Colors are color values, not color resources. The fields are annotated @ColorInt, so resolve resources first with ContextCompat.getColor(context, R.color.your_color), or use a literal such as Color.WHITE / 0xFF1B1B3A.toInt(). Passing R.color.your_color directly will produce the wrong color.

  • Icons and fonts are resource ids (@DrawableRes, @FontRes).

  • Invalid resources are ignored. If an icon or font resource cannot be loaded, the liveness session continues with the default appearance instead of failing.

  • Setting a value to null means "use the default", not "hide it". Passing closeButton = null keeps the provider's default close icon rather than removing the button.

What cannot be customized

Some aspects of the liveness screen are fixed by the SDK to protect the integrity of the verification:

  • Screen orientation (always portrait).

  • Screenshots (always disabled).

  • The camera preview filter, which is defined by your account configuration.

  • The instruction texts. These can be localized in the standard Android way — see String localization.

Accessibility

The default colors and contrast ratios are verified against WCAG 2.1 AA guidelines. Customizing colors can invalidate that compliance, so check the contrast between text and background — particularly prompt.textColor against prompt.backgroundColor, and appBar.titleColor against appBar.color.

Links:

Face Liveness LiteHandling FailuresUi CustomizationChangelog

Last updated