Skip to main content

Capture Customization

The SDK provides customization options for the camera capture and loading screens.

info

These customizations are available only when:

  • The SDK launch configuration is set to Stripped (refer to [this section]).
  • The Liveness Check Mode for Mobile is set to Type 1 in the [Partner’s Portal].

Overview​

Capture customization is defined by two main classes:

  • LoaderCustomization: For customizing the loading screen.
  • ToolbarCustomization: For customizing the toolbar on the camera capture screen.

1. Loader Customization​

The LoaderCustomization class provides options to modify the appearance of the loading screen, including background colors, spinner styles, and message properties.

PropertyDescriptionType
backgroundColorSet the background color of the loading screen.Int?
progressColorSet the color of the loading spinner.Int?
textCustom text for the loading message (set null to use default).String?
textColorSet the color of the loading message text.Int
textSizeSet the size of the loading message text.Int
strokeWidthSet the thickness of the spinner.Int
progressSizeSet the size of the loading spinner.Int
messagePositionSet the position of the loading message.MessagePosition

Message Position Options​

The MessagePosition property has three options to control the position of the loading message relative to the progress spinner:

  • MessagePosition.DEFAULT: Displays the message directly below the spinner.
  • MessagePosition.TOP: Moves the message to the top of the screen.
  • MessagePosition.BOTTOM: Moves the message to the bottom of the screen.

2. Toolbar Customization​

The ToolbarCustomization class allows modifications to the toolbar at the top of the camera capture screen. Note that these options apply only when the Liveness Check Mode for Mobile is set to Type 1.

PropertyDescriptionType
titleThe text displayed in the toolbar.String
titleColorSet the color of the toolbar title text.Int
titleSizeSet the size of the toolbar title text.Int
isTitleCenteredAlign the title either centered (true) or left-aligned (false).Boolean
backgroundColorSet the background color of the toolbar.Int
backgroundOpacitySet the transparency level of the toolbar (0 = transparent, 100 = opaque).Int
closeButtonColorSet the color of the close (X) button in the toolbar.Int

Sample Usage​

Here’s an example of how to initialize the SDK with customizations for the loading screen and toolbar:

Metric.init(
metricSettings = BasicMetricSettings(
applicationContext = this,
themeProvider = ThemeProvider(
fontProvider = FontProvider(
regular = R.font.custom_font_regular,
bold = R.font.custom_font_bold,
),
appTheme = {
AppTheme(
appName = "Example App",
logo = AppLogo.NetworkImage("https://example.com/logo.png"),
primaryColor = Color.RED,
)
},
captureCustomization = CaptureCustomization(
loaderCustomization = LoaderCustomization(
backgroundColor = Color.BLACK,
progressColor = Color.WHITE,
strokeWidth = 3,
progressSize = 70,
text = "Custom text to replace SDK messages",
textColor = Color.WHITE,
textSize = 24,
messagePosition = LoaderCustomization.MessagePosition.BOTTOM
),
toolbarCustomization = ToolbarCustomization(
title = "Capture Screen",
titleColor = Color.WHITE,
titleSize = 18,
isTitleCentered = true,
backgroundColor = Color.BLACK,
backgroundOpacity = 0,
closeButtonColor = Color.WHITE
)
)
),
authenticator = {
ClientAuthenticator(
clientKey = "...",
secretKey = "...",
)
},
environment = Environment.Dev
)
)