Capture Customization
The SDK provides customization options for the camera capture and loading screens.
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 toType 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.
Property | Description | Type |
---|---|---|
backgroundColor | Set the background color of the loading screen. | Int? |
progressColor | Set the color of the loading spinner. | Int? |
text | Custom text for the loading message (set null to use default). | String? |
textColor | Set the color of the loading message text. | Int |
textSize | Set the size of the loading message text. | Int |
strokeWidth | Set the thickness of the spinner. | Int |
progressSize | Set the size of the loading spinner. | Int |
messagePosition | Set 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
.
Property | Description | Type |
---|---|---|
title | The text displayed in the toolbar. | String |
titleColor | Set the color of the toolbar title text. | Int |
titleSize | Set the size of the toolbar title text. | Int |
isTitleCentered | Align the title either centered (true) or left-aligned (false). | Boolean |
backgroundColor | Set the background color of the toolbar. | Int |
backgroundOpacity | Set the transparency level of the toolbar (0 = transparent, 100 = opaque). | Int |
closeButtonColor | Set 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
)
)