Android UI customization
Android SDK provides various customization options with programming code or xml files.
Getting started
1. Create IdenfyUISettings
Create an instance of IdenfyUISettings class:
val idenfyUISettingsV2 = IdenfyUISettingsV2.IdenfyUIBuilderV2()
.build()
2. Update IdenfyUISettings
val idenfySettingsV2 = IdenfySettingsV2.IdenfyBuilderV2()
.withIdenfyUISettingsV2(idenfyUISettingsV2)
...
build()
SDK currently supports three ways of customization:
Customization options
Customization with IdenfyUISettingsV2:
-
Camera OnBoarding view
IdenfyUISettingsV2.IdenfyUIBuilderV2()
/**
* Confirmation View acts as additional step, which helps user to familiarize himself with identification process
* @param idenfyOnBoardingViewTypeEnum Defines onBoarding (Confirmation) view type
*/
.withConfirmationView(idenfyOnBoardingViewTypeEnum: IdenfyOnBoardingViewTypeEnum)
...
build()
The possible options of the Camera OnBoarding View are explained below:
IdenfyOnBoardingViewTypeEnum | Description | UI |
---|---|---|
SINGLE | Shows a single onBoarding view ONCE before verification process with all upcoming steps (This was a default setting prior to 7.x version) | ![]() |
MULTIPLE_STATIC | Shows an onBoarding view before EVERY step of the verification process with a static instruction list (This is a default setting starting 7.x version) | ![]() |
-
Language selection
IdenfyUISettingsV2.IdenfyUIBuilderV2()
/**
* Enables language selection window, which provides an option to change the locale
* @param isLanguageSelectionNeeded Changes visibility of locale selection
icon.
*/
.withLanguageSelection(Boolean isLanguageSelectionNeeded)
...
build()
-
Document camera rectangle visibility
Since some documents are non regular size, therefore we have an option to hide the camera rectangle. This way the whole screen is dedicated to the document capturing.
The rectangle can be hidden for all document types:
/**
* Camera rectangle will be hidden for ALL countries and document types
*/
val idenfyUISettingsV2 =
IdenfyUISettingsV2.IdenfyUIBuilderV2()
.withDocumentFrameVisibility(DocumentCameraFrameVisibility.HiddenForAllCountriesAndDocumentTypes)
.build()
or for specific countries and document types:
/**
* Camera rectangle will be hidden ONLY for Lithuanian passport
*/
val countryDocumentMap: MutableMap<String, List<DocumentTypeEnum>> = mutableMapOf()
countryDocumentMap["LT"] = mutableListOf(DocumentTypeEnum.PASSPORT)
val documentCameraFrameVisibility = DocumentCameraFrameVisibility.HiddenForSpecificCountriesAndDocumentTypes(countryDocumentMap)
val idenfyUISettingsV2 = IdenfyUISettingsV2.IdenfyUIBuilderV2()
.withDocumentFrameVisibility(documentCameraFrameVisibility)
.build()
-
Adding instructions in camera session.
The iDenfySDK provides informative instructions during the verification session. They can provide valuable information for the user and help to tackle common issues: bad lightning, wrong document side, etc. Instructions can be customized, by changing all UI elements or even using your MP4 video files. Instructions are configured by your backend settings and can be overridden with the SDK settings.
Using IdenfyInstructionsEnum dialog
Using IdenfyInstructionsEnum none
1. Enable instructions in IdenfyUISettingsV2
val idenfyUISettingsV2 = IdenfyUISettingsV2.IdenfyUIBuilderV2()
.withInstructions(IdenfyInstructionsType.DIALOG)
...
build()
Applying SDK wide color changes
If color and assets changes are the only requirement, then it can be easily customized by changing main colors.
Information about mostly used colors:
Color name | Description | Default color value |
---|---|---|
idenfyMainColorV2 | Defines the color of most single colored assets and focused parts in SDK. | #536DFE |
idenfyMainDarkerColorV2 | Defines the color of some focused parts in SDK, similar to idenfyMainColorV2. | #5D7CE4 |
idenfyBackgroundColorV2 | Defines the background color. | #FBFBFB |
idenfySecondColorV2 | Defines the text color. | #F2353B4E |
You can customize it in the following manner:
1. Override color names in your app module.
Create either a new idenfy_colors.xml or add our defined colors to your project.
2. Make color changes
Example:
<resources>
<color name="idenfyMainColorV2">#7CFC00</color>
<color name="idenfyMainDarkerColorV2">#7CFC00</color>
</resources>
Colors also are applied on images, which use a single color from idenfy drawable resources. If perhaps you decided to override our provided images with more sophisticated icons, which use more than 1 color, then you can easily disable tint on images. You need to override our defined layouts styles with the removed tint attribute.