Customization through API
UI customization through the API lets your host application configure the appearance and behavior of the VIDA SDK's UI elements at runtime, without editing any resource files. This is useful when the experience needs to change dynamically - for example, per user, brand, or flow.
Customization is driven by two builders, both applied to the same VidaLiveness instance:
VidaUICustomizationOption
UI appearance & behavior - camera overlay, locale, retries, tutorial/review screens
VidaFaceDetectionOption
Liveness detection behavior - active liveness and gesture configuration
UI Customization Options
Create an instance of VidaUICustomizationOption using its builder, set the options you need, then call .build().
Example
Options reference
setCameraOverlayStrokeWidth(int width)
width - integer
Thickness of the overlay lines/edges drawn on the camera UI.
setOverlayShape(Shape overlayShape)
overlayShape - Shape enum
Shape of the camera overlay. Accepted values below.
setLocal(Locale locale)
locale - Locale
Sets the application language for the SDK screens.
setMaxRetryAttempt(int maxRetryAttempt)
maxRetryAttempt - integer
Maximum backend retry attempts for liveness validation. Useful when connectivity issues or server downtime might cause a check to fail, so the SDK can retry and still succeed.
setShowTutorialScreen(boolean show)
show - boolean
true shows the tutorial screen that guides users through the check; false skips it.
setShowReviewScreen(boolean show)
show - boolean
true shows the review screen after capture; false skips it.
Every method returns the current VidaUICustomizationOptionBuilder instance, so calls can be chained as shown above.
Accepted Shape values for setOverlayShape():
Shape.OVAL
Oval
Shape.CIRCLE
Circle
Shape.SQUARE
Square
Shape.RECTANGLE
Rectangle
Applying the options
Pass the built VidaUICustomizationOption to the VidaLiveness instance using setUICustomizationOptions(), then initialize:
This applies your UI customization (and detection) settings throughout the liveness flow.
Active Liveness Options
Active liveness is configured separately, through VidaFaceDetectionOption, and passed to the same VidaLiveness instance via setDetectionOptions().
Enable active liveness
Customize gestures
Use setAllowedGestures(HashSet<Gestures> allowedGestures) to choose which gestures the user must perform. There are two valid gesture sets:
Zoom
ZOOM_FACE
Movement
any combination of BLINK, SMILE, SHAKE_HEAD
Minimum stable frame (optional)
setZoomGestureMinimumStableFrame() sets the minimum number of continuous frames that must satisfy the quality parameters. These frames are used for stable image capture and liveness analysis.
Last updated
