MrzScannerConfig

Options for MrzScannerScreen. Build it with the MrzScannerConfig function.

The configuration is read when the scanner opens; changes while it is open apply the next time it opens.

Since

0.5.0

Types

Link copied to clipboard
class Builder

Collects MrzScannerConfig options. Use the MrzScannerConfig function instead of calling it directly.

Properties

Link copied to clipboard

The kinds of document the app takes, as DocumentCategory values. This is the app's intake rule; the SDK does not judge the document. Default: every category. A reading whose category is not in the set does not go to review and is not returned; the screen says what kind it read and what kinds the app accepts, and lets the person go on (the camera keeps scanning, a photo can be swapped, typed lines stay on the entry screen). The category comes from DocumentType.broadCategory. When that is null (a document type code whose kind the SDK cannot tell) and the set is not every category, the reading is treated the same way: the screen says the kind could not be told and what the app accepts, and the person can go on. With the default (every category) such a reading is not filtered and goes to review as usual. Applies to all three reading methods. Must not be empty; Builder.build throws IllegalArgumentException otherwise. Added in 1.0.0.

Link copied to clipboard

Number of live-camera frames that must decode the same document before it is accepted. Default 2 (MrzDecodeConsensus.DEFAULT_THRESHOLD); 1 accepts the first decode. Applies to the live camera only. Must be at least 1; Builder.build throws IllegalArgumentException otherwise.

Link copied to clipboard

Reading methods the screen offers. Default: ScanMethod.CAMERA and ScanMethod.MANUAL_ENTRY. Add ScanMethod.SAVED_IMAGE to opt in to photo reading. The screen starts on the first present of camera, manual entry, saved image.

Link copied to clipboard

Plays a short haptic when a live-camera read is accepted. Default true.

Link copied to clipboard

Called when the user taps the grant button on the permission screen. The screen never requests the permission itself. With null (default) the screen shows no grant button.

Link copied to clipboard

What happens when an MRZ decodes. Default ReviewMode.REVIEW.

Link copied to clipboard

Deadline for the whole session, across every screen. When it passes, the screen reports MrzScannerResult.Cancelled with DismissReason.TIMED_OUT. Default Duration.INFINITE (no deadline). It counts only foreground time and pauses while the app is not resumed, for example in the background or with the device locked. A camera held by another app does not pause it. A finite value shows a countdown.

Link copied to clipboard

Shows the torch toggle over the live preview when the camera has a flash unit. Default true.

Link copied to clipboard

Time on the live preview before the "still looking" hint can appear. Default 10 seconds, counted from when the camera becomes active. The hint shows when the time is up, whatever the camera sees; Duration.INFINITE never shows it.

Link copied to clipboard

Brand and appearance options. See MrzScannerTheme.

Link copied to clipboard

Starts with the torch on. Default false.