The ID Verification Android SDK provides the setCustomUIConfig interface for customizing user interface (UI) colors and icons. You can create custom UI configurations as a file or in JSON data format and pass them to the setCustomUIConfig interface to apply custom UI effects. This topic describes the UI customization interface and provides code examples.
Some custom configurations may require an SDK upgrade. Upgrade the SDK to the latest version before you use these configurations. If custom user interface settings conflict with the extension parameters of the verification interface, the user interface settings take precedence. This ensures a consistent and intuitive user experience.
Interface description
Interface definition
The Android SDK provides the setCustomUIConfig interface for customizing UI colors and icons. Call this method and pass the required parameters to apply custom UI effects.
/**
* Sets custom UI colors and icons.
*
* @return The exception information detected in the configuration file.
* @description This interface is used to set a custom UI.
* @paramType paramType The parameter type {@link IDTFacade}. Valid values:
* {@link IDTFacade.EXT_PARAMS_CONFIG_JSON} | {@link IDTFacade.EXT_PARAMS_CONFIG_ASSETS_NAME}).
*
* @params {@link String} params The parameter value, which corresponds to paramType.
*/
public String setCustomUIConfig(@IDTFacade int paramType, String param) {
// ...
}Input parameters
Name | Type | Description |
paramType | int | The type of the custom input parameter. Valid values:
|
param | String | The data to be passed in based on the value of paramType. |
Return value
This method returns a string. If an error or exception occurs when the SDK parses the content of the param parameter, it returns an error message. If the configuration parameters are invalid, review the returned message for more information.
Sample code
// Pass the assets file name.
String fileName = "DTFCustomUIConfig.json";
int paramType = IDTFacade.EXT_PARAMS_CONFIG_ASSETS_NAME;
String customUIErrMsg = IdentityPlatform.getInstance().setCustomUIConfig(paramType, fileName);
// Pass a JSON string.
String jsonConfig = "<Custom UI configuration in JSON format>";
int paramType = IDTFacade.EXT_PARAMS_CONFIG_JSON;
String customUIErrMsg = IdentityPlatform.getInstance().setCustomUIConfig(paramType, jsonConfig);Custom UI configuration
You can customize font colors and certain icons on the authentication page.
Complete configuration example
{
"faceConfig": {
"faceBGColor": "#A8D8B4",
"exitIconBase64": "exit_icon_base64",
"faceTitleColor": "#3E5E7E",
"faceTipColor": "#F0E68C",
"interruptedAlertTitleColor": "#FF6347",
"interruptedAlertMessageColor": "#4682B4",
"interruptedAlertConfirmColor": "#DDA0DD",
"permissionFailedAlertTitleColor": "#6A5ACD",
"permissionFailedAlertMessageColor": "#8A2BE2",
"permissionFailedAlertConfirmColor": "#5F9EA0",
"tooManyRetriesAlertTitleColor": "#DC143C",
"tooManyRetriesAlertMessageColor": "#00FFFF",
"tooManyRetriesAlertConfirmColor": "#B8860B",
"faceProgressStartColor": "#006400",
"faceProgressEndColor": "#BDB76B",
"exitAlertTitleColor": "#8B008B",
"exitAlertMessageColor": "#556B2F",
"exitAlertCancelColor": "#FF8C00",
"exitAlertConfirmationColor": "#9932CC",
"timeoutAlertTitleColor": "#E9967A",
"timeoutAlertMessageColor": "#8FBC8F",
"timeoutAlertConfirmationColor": "#483D8B",
"verifyLoadingColor": "#2F4F4F",
"verifyNetworkErrorAlertTitleColor": "#00CED1",
"verifyNetworkErrorAlertMessageColor": "#9400D3",
"verifyNetworkErrorAlertCancelColor": "#FF1493",
"verifyNetworkErrorAlertConfirmColor": "#00BFFF"
},
"ocrConfig": {
"exitIconBase64": "exit_icon_base64",
"ocrTitleColor": "#696969",
"ocrBorderColor": "#1E90FF",
"albumBase64": "album_base64",
"takePhotoBase64": "take_photo_base64",
"submitBase64": "submit_base64",
"ocrSubmitTitleColor": "#B22222",
"ocrLoadingColor": "#FFFAF0",
"failedAlertTitleColor": "#228B22",
"failedAlertMessageColor": "#FF00FF",
"failedAlertCancelColor": "#DCDCDC",
"failedAlertConfirmationColor": "#F8F8FF",
"ocrNetworkErrorAlertTitleColor": "#FFD700",
"ocrNetworkErrorAlertMessageColor": "#DAA520",
"ocrNetworkErrorAlertCancelColor": "#808080",
"ocrNetworkErrorAlertConfirmColor": "#008000",
"permissionFailedAlertTitleColor": "#ADFF2F",
"permissionFailedAlertMessageColor": "#F0FFF0",
"permissionFailedAlertConfirmColor": "#FF69B4",
"docErrorAlertTitleColor": "#CD5C5C",
"docErrorAlertMessageColor": "#4B0082",
"docErrorAlertCancelColor": "#FFFFF0",
"docErrorAlertConfirmColor": "#F0E68C",
"restrictionsAlertTitleColor": "#E6E6FA",
"restrictionsAlertMessageColor": "#FFF0F5",
"restrictionsAlertConfirmationColor": "#7CFC00",
"timeoutAlertTitleColor": "#FFFACD",
"timeoutAlertMessageColor": "#ADD8E6",
"timeoutAlertConfirmationColor": "#F08080",
"exitAlertTitleColor": "#E0FFFF",
"exitAlertCancelColor": "#FAFAD2",
"exitAlertConfirmationColor": "#D3D3D3",
"ocrMessageFailAlertTitleColor": "#90EE90",
"ocrMessageFailAlertCancelColor": "#FFB6C1",
"ocrMessageFailAlertConfirmColor": "#FFA07A",
"ocrResultExitIconBase64": "ocr_result_exit_icon_base64",
"ocrResultTitleColor": "#20B2AA",
"ocrResultTipBGColor": "#87CEFA",
"ocrResultTipColor": "#778899",
"ocrResultInfoTitleColor": "#B0C4DE",
"ocrResultInfoContentColor": "#FFFFE0",
"ocrResultConfirmBtnEnabledBGColor": "#00FF00",
"ocrResultConfirmBtnEnabledTitleColor": "#32CD32",
"ocrResultTipTitleColor": "#FAF0E6",
"ocrResultTipIconBase64": "ocr_result_tip_icon_base64",
"ocrResultErrorTipBGColor": "#FF00FF",
"ocrResultInfoBorderColor": "#800000",
"ocrResultConfirmBtnDisabledBGColor": "#66CDAA",
"ocrResultConfirmBtnDisabledTitleColor": "#0000CD",
"ocrResultExitAlertTitleColor": "#BA55D3",
"ocrResultExitAlertCancelColor": "#9370DB",
"ocrResultExitAlertConfirmationColor": "#3CB371",
"ocrResultInfoEmptyAlertTitleColor": "#7B68EE",
"ocrResultInfoEmptyAlertConfirmColor": "#00FA9A",
"ocrResultNetworkErrorAlertTitleColor": "#48D1CC",
"ocrResultNetworkErrorAlertMessageColor": "#C71585",
"ocrResultNetworkErrorAlertConfirmColor": "#191970",
"ocrResultNetworkErrorAlertCancelColor": "#F5FFFA",
"ocrResultInfoErrorAlertMessageColor": "#FFE4E1",
"ocrResultInfoErrorAlertConfirmColor": "#FFE4B5",
"unFloodLightBase64": "un_flood_light_base64",
"floodLightBase64": "flood_light_base64",
"autoScanBase64": "auto_scan_base64",
"takeShootBase64": "take_shoot_base64",
"ocrTakePhotoLabelColor": "#FFDEAD",
"ocrAlbumLabelColor": "#000080",
"ocrGuideExitIconBase64": "ocr_guide_exit_icon_base64",
"ocrGuideTitleColor": "#FDF5E6",
"ocrGuideContentColor": "#808000",
"ocrGuideStartBtnBGColor": "#6B8E23",
"ocrGuideStartBtnTextColor": "#FFA500",
"ocrGuideIndicatorSelectedColor": "#FF4500",
"ocrGuideIndicatorUnSelectedColor": "#DA70D6",
"nfcInputExitIconBase64": "nfc_input_exit_icon_base64",
"nfcInputTitleColor": "#EEE8AA",
"nfcInputPassportLabelColor": "#98FB98",
"nfcInputBirthdayLabelColor": "#AFEEEE",
"nfcInputValidityLabelColor": "#DB7093",
"nfcInputPassportEditColor": "#FFEFD5",
"nfcInputBirthdayEditColor": "#FFDAB9",
"nfcInputValidityEditColor": "#CD853F",
"nfcInputPassportEditHintColor": "#FFC0CB",
"nfcInputBirthdayEditHintColor": "#DDA0DD",
"nfcInputValidityEditHintColor": "#B0E0E6",
"nfcInputNextBtnBGSelectColor": "#800080",
"nfcInputNextBtnTextSelectColor": "#663399",
"nfcInputNextBtnBGUnSelectColor": "#FF0000",
"nfcInputNextBtnTextUnSelectColor": "#BC8F8F",
"nfcInputBackAlertTitleColor": "#4169E1",
"nfcInputBackAlertCancelColor": "#8B4513",
"nfcInputBackAlertConfirmColor": "#FA8072",
"nfcInputCheckAlertTitleColor": "#F4A460",
"nfcInputCheckAlertMessageColor": "#2E8B57",
"nfcInputCheckAlertConfirmColor": "#A0522D",
"nfcExitIconBase64": "nfc_exit_icon_base64",
"nfcTitleColor": "#C0C0C0",
"nfcContentColor": "#87CEEB",
"nfcConfirmBtnBGColor": "#6A5ACD",
"nfcConfirmBtnTextColor": "#708090",
"nfcReadBackAlertTitleColor": "#00FF7F",
"nfcReadBackAlertConfirmColor": "#4682B4",
"nfcReadBackAlertCancelColor": "#D2B48C",
"nfcSettingAlertTitleColor": "#D2691E",
"nfcSettingAlertMessageColor": "#9ACD32",
"nfcSettingAlertConfirmColor": "#FF7F50",
"nfcSettingAlertCancelColor": "#6495ED",
"nfcReadStatusExitBase64": "nfc_read_status_exit_base64",
"nfcReadStatusTextColor": "#DC143C",
"ocrGuideStartBtnDisableBGColor":"#d5d5d5",
"ocrGuideStartBtnDisableTextColor":"#F9F9FA"
}
}Field configuration effects
faceModule
faceBGColor
| exitIconBase64
| faceTitleColor
|
faceTipColor
| interruptedAlertTitleColor
| interruptedAlert Message Color
|
interruptedAlert Confirm Color
| permissionFailedAlertTitleColor
| permissionFailedAlert Message Color
|
permissionFailedAlert Confirm Color
| tooManyRetriesAlertTitleColor
| tooManyRetriesAlertMessageColor
|
tooManyRetriesAlertConfirmColor
| faceProgressStartColor
| faceProgressEndColor
|
exitAlertTitleColor
| exitAlertMessageColor
| exitAlertCancelColor
|
exitAlertConfirmationColor
| timeoutAlertTitleColor
| timeoutAlertMessageColor
|
timeoutAlertConfirmationColor
| verifyLoadingColor
| verify NetworkErrorAlertTitleColor
|
verifyNetworkErrorAlert Message Color
| verifyNetworkErrorAlertCancelColor
| verifyNetworkErrorAlert Confirm Color
|
ocrModule
exitIconBase64
| ocrTitleColor
| OCR Border Color
|
albumBase64 | takePhotoBase64
| submitBase64
|
ocrSubmitTitleColor
| ocrLoadingColor
| failedAlertTitleColor
|
failedAlertMessageColor
| failedAlertCancelColor
| failedAlertConfirmationColor
|
ocrNetworkErrorAlertTitleColor
| ocrNetworkErrorAlertMessage Color
| ocrNetworkErrorAlertCancelColor
|
ocrNetworkErrorAlertConfirm Color
| permissionFailedAlertTitleColor
| permissionFailedAlert Message Color
|
permissionFailedAlert Confirm Color
| docErrorAlertTitleColor
| docErrorAlert Message Color
|
docErrorAlertCancelColor
| docErrorAlert Confirm Color
| restrictionsAlertTitleColor
|
restrictionsAlertMessageColor
| restrictionsAlertConfirmationColor
| timeoutAlertTitleColor
|
timeoutAlertMessageColor
| timeoutAlertConfirmationColor
| exitAlertTitleColor
|
exitAlertCancelColor
| exitAlertConfirmationColor
| ocrMessageFailAlertTitleColor
|
ocrMessageFailAlertCancelColor
| ocrMessageFailAlertConfirmColor
| ocrResult ExitIconBase64
|
ocrResultTitleColor
| ocrResultTipBGColor
| ocr ResultTipColor
|
ocrResultInfoTitleColor
| ocrResultInfoContentColor
| ocrResultConfirmBtnEnabledBGColor
|
ocrResultConfirmBtnEnabledTitleColor
| ocrResultTipTitleColor
| ocrResultTipIconBase64
|
ocrResultErrorTipBGColor
| ocrResultInfoborderColor
| ocrResultConfirmBtnDisabledBGColor
|
ocrResultConfirmBtnDisabledTitleColor
| ocrResultExitAlertTitleColor
| ocrResultExitAlertCancelColor
|
ocrResultExitAlertConfirmationColor
| ocrResultInfoEmptyAlertTitleColor
| ocrResultInfoEmptyAlert Confirm Color
|
ocrResultNetworkErrorAlertTitleColor
| ocrResultNetworkErrorAlert Message Color
| ocrResultNetworkErrorAlert Confirm Color
|
ocrResultNetworkErrorAlert Cancel Color
| ocrResultInfoErrorAlert Message Color
| ocrResultInfoErrorAlert Confirm Color
|
unFloodLightBase64
| floodLightBase64
| autoScanBase64
|
takeShootBase64
| ocrTakePhotoLabelColor
| ocrAlbumLabelColor
|
ocrGuideExitIconBase64
| ocrGuideTitleColor
| ocrGuideContentColor |
ocrGuideStartBtnBGColor
| ocrGuideStartBtnTextColor
| ocrGuideIndicatorSelectedColor
|
ocrGuideIndicatorUnSelectedColor
| nfcInputExitIconBase64
| nfcInputTitleColor
|
nfcInputPassportLabelColor
| nfcInputBirthdayLabelColor
| nfcInputValidityLabelColor
|
nfcInputPassportEditColor
| nfcInputBirthdayEditColor
| nfcInputValidityEditColor
|
nfcInputPassportEditHintColor
| nfcInputBirthdayEditHintColor
| nfcInputValidityEditHintColor
|
nfcInputNextBtnBGSelectColor
| nfcInputNextBtnTextSelectColor
| nfcInputNextBtnBGUnSelectColor
|
nfcInputNextBtnTextUnSelectColor
| nfcInputBackAlertTitleColor
| nfcInputBackAlertCancelColor
|
nfcInputBackAlertConfirmColor
| nfcInputCheckAlertTitleColor
| nfcInputCheckAlertMessageColor
|
nfcInputCheckAlertConfirmColor
| nfcExitIconBase64
| nfcTitleColor
|
nfcContentColor
| nfcConfirmBtnBGColor
| nfcConfirmBtnTextColor
|
nfcReadBackAlertTitleColor
| nfcReadBackAlertConfirmColor
| nfcReadBackAlertCancelColor
|
nfcSettingAlertTitleColor
| nfcSettingAlertMessageColor
| nfcSettingAlertConfirmColor
|
nfcSettingAlertCancelColor
| nfcReadStatusExitBase64
| nfcReadStatusTextColor
|
ocrGuideStartBtnDisableTextColor | ocrGuideStartBtnDisableBGColor |







































































































































