UI Customization
The Keyless SDK can be customized in order to provide a seamless UX when integrated in a custom app.

Colors

All the color overrides have to be placed in your /values/colors.xml file; the possible values are:
klBackgroundColor
The background color of the enrollment screen
klForegroundColor
The color of the texts
klPrimaryColor
The color of the animated circle during the authentication
klSecondaryColor
The color of the spinning dots during the enrollment
Example:
1
<?xml version="1.0" encoding="utf-8"?>
2
<resources>
3
<color name="klBackgroundColor">#ee444400</color>
4
<color name="klForegroundColor">#ff0000</color>
5
<color name="klPrimaryColor">#00ff00</color>
6
<color name="klSecondaryColor">#0000ff</color>
7
</resources>
Copied!

Texts

The following strings can be overridden in your app /value/strings.xml file.
Please note that during the enrollment, three lines of text will be displayed at max and during the authentication/de-enrollment two lines of text will be displayed at max.
Identifier
Default
enroll_step_1_text_1
Position your face within the frame
enroll_step_2_text_1
Enrolling, please wait…
Displayed from 0% to 33% of enrollment progress
enroll_step_2_text_2
Enrolling, please wait…
Displayed from 34% to 66% of enrollment progress
enroll_step_2_text_3
Enrolling, please wait…
Displayed from 67% to 100% of enrollment progress
enroll_step_3_text_1
Keyless account created successfully!
authentication_step_1
Please look into the camera
authentication_step_2
Communicating with the Keyless network
authentication_step_3
Approved!
Example:
1
<resources>
2
3
<!-- Enroll -->
4
<string name="enroll_step_1_text_1">Position your face within the frame</string>
5
<string name="enroll_success">Success</string>
6
<string name="enroll_step_2_text_1">Enrolling, please wait…</string>
7
<string name="enroll_step_2_text_2">Enrolling, please wait…</string>
8
<string name="enroll_step_2_text_3">Enrolling, please wait…</string>
9
<string name="enroll_step_3_text_1">Keyless account created successfully!</string>
10
11
<!-- Authentication -->
12
<string name="authentication_step_1">Please look into the camera</string>
13
<string name="authentication_step_2">Communicating with the Keyless network</string>
14
<string name="authentication_step_3">Approved!</string>
15
16
</resources>
Copied!

Font sizes

Fonts size can be overridden in your app /values/dimens.xml file; two values can be modified:
Identifier
Default
Description
klRegularFontSize
18sp
The font size used during the enrollment.
klSmallFontSize
14sp
The font size used during the authentication.
Example
1
<?xml version="1.0" encoding="utf-8"?>
2
<resources>
3
<dimen name="klRegularFontSize">30sp</dimen>
4
<dimen name="klSmallFontSize">25sp</dimen>
5
</resources>
Copied!

Font families

Fonts must be .otf or .ttf and have to be put in /res/font folder; the font family can be changed in your /values/styles.xml file.
Example:
1
<resources>
2
3
<!-- Base application theme. -->
4
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5
<!-- Customize your theme here. -->
6
7
<item name="android:fontFamily">@font/your_font</item>
8
<item name="fontFamily">@font/your_font</item>
9
10
</style>
11
12
</resources>
Copied!
You can show your custom logo during Enrollment, Authentication and de-enrollment. It will be shown in the upper-right corner; any custom logo can be used, it will be resized but not stretched.
Add your own image called kl_logo_image.png in your /res/drawable folder to show it.
Last modified 5mo ago
Export as PDF
Copy link