Skip to main content
Version: v2

Customizing the look

It is not possible to move elements of the UI around, remove parts of the UI, or add new parts. To build your own screens, use the engine instead; read Platform SDK architecture.

The Microblink Platform SDK comes with the ability to customize some aspects of the UI by using the UI theming. The screens can be customized to fit your app’s look and feel by defining UI settings in UiConfiguration, which you pass to MicroblinkPlatformConfiguration as ui.

Customization 1 Customization 2 Customization 3 Customization 4 Customization 5

Images​

It is possible to change the images on the home screen, the camera permission screen, and each of the possible result screens. Pass the drawables in MicroblinkPlatformImages:

ui = UiConfiguration(
images = MicroblinkPlatformImages(
home = R.drawable.my_home,
verificationFail = R.drawable.my_verification_fail,
verificationSuccess = R.drawable.my_verification_success,
verificationReview = R.drawable.my_verification_review,
cameraPermission = R.drawable.my_camera_permission,
),
)

Fonts​

typography takes a MicroblinkPlatformTypography, with a TextStyle for each kind of text on our screens. To change only the FontFamily of all texts, use the SDK's default typography, and pass it a different FontFamily. All of the other parameters (font weight, font size, line height, and so on) stay the same:

// load any FontFamily
private val allerta = FontFamily(
Font(R.font.allerta, FontWeight.Normal),
)

ui = UiConfiguration(
typography = MicroblinkPlatformTypography.default(allerta),
)

To change other parameters, change the styles of the texts you want to change. For example, to change the titles of the home and result screens:

ui = UiConfiguration(
typography = MicroblinkPlatformTypography.default().copy(
heading = TextStyle(
fontWeight = FontWeight.Bold,
fontSize = 28.sp,
lineHeight = 32.sp,
),
),
)

MicroblinkPlatformTypography has these styles:

  • heading: the titles of the home and result screens, the form, and the document upload screens.
  • description: the text under a screen's title, and the document upload guidelines.
  • subtitle: the titles inside a screen, such as the sides of an ID document and the upload area.
  • homeStepTitle: the step titles and statuses on the home screen.
  • homeStepDescription: the text under the step titles on the home screen.
  • info: the notice on the home screen, document descriptions, and the texts of dialogs.
  • fieldTitle: field labels, and the label of the document type selector.
  • fieldBody: field values, checkbox and file field names, document and file names, and the document type options.
  • fieldDescription: the text under a field, such as its description or error, file sizes, upload hints, and upload errors.
  • titleProgressAndErrors: the titles of the loading, error, and camera permission screens.
  • dialogTitle: the titles of dialogs and bottom sheets.
  • button: buttons, including those in dialogs.

Scanning screens​

typography doesn't change the fonts of the document scanning, card scanning, and face capture screens. To change them, set scannerTypography:

ui = UiConfiguration(
scannerTypography = ScannerTypography(
scanningInstructions = TextStyle(fontFamily = allerta, fontSize = 16.sp),
faceCaptureInstructions = TextStyle(fontFamily = allerta, fontSize = 20.sp),
),
)

A style replaces the whole default style of its text, so set its size too. A style you leave null keeps the scanning SDK's own. The scanning screens take their text colors from colorScheme, so the color of a style may be ignored.

ScannerTypography has styles for the onboarding screen (onboardingTitle, onboardingText, onboardingButton), the help dialog (helpDialogTitle, helpDialogText, helpDialogButton), the error dialog (errorDialogTitle, errorDialogText, errorDialogButton), the guidance over the camera on the document and card scanning screens (scanningInstructions), the help tooltip (helpTooltip), the loading screen (loadingScreen), and the guidance on the face capture screen (faceCaptureInstructions, which is always white).

Colors​

To change the color scheme (for example, button or background colors), set an androidx.compose.material3.ColorScheme:

ui = UiConfiguration(
colorScheme = lightColorScheme(
primary = Cobalt,
surface = Color.White,
),
)

Our screens use surface as their background, not background. lightColorScheme sets every color that you don't pass to the Material 3 default, rather than to our default.

The primary, onPrimary, surface, and onSurface colors also color the document scanning, card scanning, and face capture screens. surface is their background, and onSurface the text on it. These screens don't follow the phone's dark theme.

Button shape​

To change the shape of the buttons, set buttonShape. It applies to every button on our screens, including those in dialogs:

ui = UiConfiguration(
buttonShape = RoundedCornerShape(8.dp),
)