Customization
See Theme for additional info about customizing.
FaceCameraSettings
FaceCameraSettings is an object that can be passed to the face camera in order to modify its behaviour. The settings object is created via the FaceCameraSettingsBuilder documented below and accessible via FaceCameraSettings.builder().
/**
* Factory for creating a [FaceCameraSettings] object.
*/
interface FaceCameraSettingsBuilder {
enum class MovementStrictness {
Strict,
Medium,
Permissive
}
/**
* Creates and returns a [FaceCameraSettings] object with the options specified.
*/
fun build(): FaceCameraSettings
/**
* Sets how strict the detection for face movement is. Stricter values may make capture
* take slightly longer and make capture more difficult in shaky environments, but are
* more likely to result in sharp images that will process correctly via the backend.
* Lower strictness makes capture easier, but may result in more blurry images that get
* rejected by the backend. For the vast majority of implementations we recommend not
* changing this from the default value of [MovementStrictness.Medium].
*/
fun setMovementStrictness(strictness: MovementStrictness): FaceCameraSettingsBuilder
}
Localization
Localization is supported following the standard way to localize in Android (exposing all strings via strings.xml). The following tables contain string identifiers and brief descriptions of what those strings correspond to on screen.
<resources>
<!-- feedback -->
<string name="smart_capture_face_photo_captured">Photo Capturing</string>
<string name="smart_capture_face_one_face_only">One face only</string>
<string name="smart_capture_face_position_in_oval">Position your face within the oval</string>
<string name="smart_capture_face_fill_oval">Fill the oval</string>
<string name="smart_capture_face_face_camera_directly">Face the camera directly</string>
<string name="smart_capture_face_move_back_and_fill_oval">Move back and fill the oval</string>
<string name="smart_capture_face_hold_still">Hold still</string>
<string name="smart_capture_face_open_eyes">Keep eyes open</string>
<!-- misc -->
<string name="smart_capture_face_camera_permission_request_text">The camera is required to capture photos. If the permission has been declined you will need to manually go to the app settings to enable it.\n</string>
<string name="smart_capture_face_ok">@android:string/ok</string>
<string name="smart_capture_face_please_rotate_your_device">Please rotate your device to portrait to take a selfie</string>
<string name="smart_capture_face_rotate_upright">Turn your phone upright</string>
<!-- alt texts for images -->
<string name="smart_capture_face_green_checkmark_alt_text">Image of a green checkmark in a green circle</string>
<string name="smart_capture_face_triangle_alt_text">Image of an orange exclamation mark in an orange triangle</string>
<string name="smart_capture_rotate_phone_alt_text">Image of a phone being rotated to portrait</string>
</resources>