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.
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.
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.
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.
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.
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 withContextCompat.getColor(context, R.color.your_color), or use a literal such asColor.WHITE/0xFF1B1B3A.toInt(). PassingR.color.your_colordirectly 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
nullmeans "use the default", not "hide it". PassingcloseButton = nullkeeps 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:
Last updated

