Class DocumentVerificationUISettings
- java.lang.Object
-
- com.microblink.documentverification.uisettings.UISettings<DocumentVerificationOverlayController>
-
- com.microblink.documentverification.uisettings.DocumentVerificationUISettings
-
- All Implemented Interfaces:
BackSideScanningTimeoutUIOptions,BeepSoundUIOptions,CurrentImageListenerUIOptions,DebugImageListenerUIOptions,DocumentDataMatchUIOptions,DocumentNotSupportedDialogUIOptions,FlashlightWarningUIOptions,HighResSuccessFrameCaptureUIOptions,MrzDetectionUIOptions,OcrResultDisplayUIOptions,SplashScreenUIOptions,StringsUIOptions<DocumentVerificationStrings>,StyleUIOptions
public class DocumentVerificationUISettings extends UISettings<DocumentVerificationOverlayController> implements BeepSoundUIOptions, DebugImageListenerUIOptions, CurrentImageListenerUIOptions, HighResSuccessFrameCaptureUIOptions, SplashScreenUIOptions, OcrResultDisplayUIOptions, DocumentDataMatchUIOptions, MrzDetectionUIOptions, DocumentNotSupportedDialogUIOptions, BackSideScanningTimeoutUIOptions, StringsUIOptions<DocumentVerificationStrings>, StyleUIOptions, FlashlightWarningUIOptions
-
-
Field Summary
-
Fields inherited from interface com.microblink.documentverification.uisettings.options.BackSideScanningTimeoutUIOptions
TIMEOUT_INFINITY
-
-
Constructor Summary
Constructors Constructor Description DocumentVerificationUISettings(android.content.Intent intent)DocumentVerificationUISettings(DocumentVerificationRecognizerTransferable documentVerificationRecognizerTransferable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentVerificationOverlayControllercreateOverlayController(android.app.Activity activity, ScanResultListener scanResultListener)Creates overlay controller and configures it using set values.protected DocumentVerificationOverlaySettingscreateOverlaySettings(android.content.Context context)voidenableHighResSuccessFrameCapture(boolean enabled)Sets whether to enable capturing high res frames on recognition success.DocumentVerificationRecognizerTransferablegetDocumentVerificationRecognizerTransferable()protected booleangetShowFlashlightWarning()protected DocumentVerificationStringsgetStrings()protected intgetStyle()java.lang.Class<?>getTargetActivity()Returns target activity.voidsaveToIntent(android.content.Intent intent)Saves this scan activity settings toIntentso it can be passed to the corresponding scan activity.voidsetBackSideScanningTimeoutMs(long backSideScanningTimeoutMs)Set back side scanning timeout in milliseconds, default is 17 000 milliseconds.voidsetBeepSoundResourceID(int beepSoundResourceID)Defines the resource ID of the sound to be played when recognition is successful.voidsetCurrentImageListener(CurrentImageListener currentImageListener)Sets implementation ofCurrentImageListenerinterface that will obtain images that are currently being processed.voidsetDebugImageListener(DebugImageListener debugImageListener)Sets implementation ofDebugImageListenerinterface that will obtain images that are being processed.voidsetDocumentDataMatchRequired(boolean isRequired)If set to true, user won't be able to finish the scanning process if data read from front and back sides doesn't match.voidsetDocumentTypeUi(DocumentTypeUi documentTypeUi)Sets document type for the onboarding and info screen UI.voidsetKeepScreenOn(boolean keepScreenOn)Defines whether system timeout will be disabled and screen kept always ON while scanning document.voidsetOcrResultDisplayMode(OcrResultDisplayMode ocrResultDisplayMode)Defines mode in which OCR result will be drawn on camera preview.voidsetOverlayViewStyle(int styleResourceID)Provide your own style to replace default icons and colors.voidsetShowFlashlightWarning(boolean showFlashlightWarning)Defines whether flashlight warning will be displayed in UI, when flashlight is turned ON.voidsetShowHoldInHandDialog(boolean showHoldInHandDialog)Defines whether camera overlay will show a dialog with instructions to hold the document in hand at the beginning of the scanning process.voidsetShowMrzDetection(boolean showOcrResult)Defines whether detection of MRZ(Machine Readable Zone) will be displayed in UI, default istrue.voidsetShowNotSupportedDialog(boolean showNotSupportedDialog)Defines whether Document Not Supported dialog will be displayed in UI, default istrue.voidsetShowTooltipTimeIntervalMs(long showTooltipTimeIntervalMs)Sets time interval between the start of the tilt step and displaying the help tooltip.voidsetSplashScreenLayoutResourceID(int splashScreenLayoutResourceID)Defines the ID of the layout resource that will be used as camera splash screen displayed while camera is being initialized.voidsetStrings(DocumentVerificationStrings strings)Sets strings that will be used in the UI.voidsetTiltStartTimeIntervalMs(long tiltStartTimeInterval)Sets time interval between neutral tilt step and first tilt step (left, right, top or down).voidsetTiltStepTimeoutIntervalMs(long tiltStepTimeoutInterval)Sets timeout interval for each tilt step.protected booleanshouldKeepScreenOn()-
Methods inherited from class com.microblink.documentverification.uisettings.UISettings
getActivityTheme, getFilterTouchesWhenObscured, getUsingFlagSecure, setActivityTheme, setCameraSettings, setFilterTouchesWhenObscured, setUsingFlagSecure
-
-
-
-
Constructor Detail
-
DocumentVerificationUISettings
public DocumentVerificationUISettings(@NonNull DocumentVerificationRecognizerTransferable documentVerificationRecognizerTransferable)
-
DocumentVerificationUISettings
public DocumentVerificationUISettings(@NonNull android.content.Intent intent)
-
-
Method Detail
-
getDocumentVerificationRecognizerTransferable
@NonNull public DocumentVerificationRecognizerTransferable getDocumentVerificationRecognizerTransferable()
-
saveToIntent
public void saveToIntent(@NonNull android.content.Intent intent)Description copied from class:UISettingsSaves this scan activity settings toIntentso it can be passed to the corresponding scan activity. Intent target activity must be set before calling this method, and target activity must be compatible with this settings. DO NOT USE THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING. Improper usage will crash your app.- Overrides:
saveToIntentin classUISettings<DocumentVerificationOverlayController>- Parameters:
intent- Intent to which this scan activity settings should be saved.
-
getStyle
@StyleRes protected int getStyle()
-
setOverlayViewStyle
public void setOverlayViewStyle(int styleResourceID)
Provide your own style to replace default icons and colors. Supports attributes from R.styleable.DocumentVerificationReticleOverlay.- Specified by:
setOverlayViewStylein interfaceStyleUIOptions- Parameters:
styleResourceID- your style
-
setBackSideScanningTimeoutMs
public void setBackSideScanningTimeoutMs(long backSideScanningTimeoutMs)
Description copied from interface:BackSideScanningTimeoutUIOptionsSet back side scanning timeout in milliseconds, default is 17 000 milliseconds. If set to 0, dialog will not be shown.- Specified by:
setBackSideScanningTimeoutMsin interfaceBackSideScanningTimeoutUIOptions- Parameters:
backSideScanningTimeoutMs- timeout in milliseconds.
-
setBeepSoundResourceID
public void setBeepSoundResourceID(@RawRes int beepSoundResourceID)Description copied from interface:BeepSoundUIOptionsDefines the resource ID of the sound to be played when recognition is successful.- Specified by:
setBeepSoundResourceIDin interfaceBeepSoundUIOptions- Parameters:
beepSoundResourceID- resource ID of the sound to be played when recognition is successful.
-
setCurrentImageListener
public void setCurrentImageListener(@Nullable CurrentImageListener currentImageListener)Description copied from interface:CurrentImageListenerUIOptionsSets implementation ofCurrentImageListenerinterface that will obtain images that are currently being processed.CurrentImageListenerwill receive all possible images that become available during recognition process.- Specified by:
setCurrentImageListenerin interfaceCurrentImageListenerUIOptions- Parameters:
currentImageListener- Implementation of image listener ornullto clear listener that has been set previously.
-
setDebugImageListener
public void setDebugImageListener(@Nullable DebugImageListener debugImageListener)Description copied from interface:DebugImageListenerUIOptionsSets implementation ofDebugImageListenerinterface that will obtain images that are being processed. DebugImageListener will receive all possible debug images that become available during recognition process.- Specified by:
setDebugImageListenerin interfaceDebugImageListenerUIOptions- Parameters:
debugImageListener- Implementation of debug image listener ornullto clear listener that has been set previously.
-
setDocumentDataMatchRequired
public void setDocumentDataMatchRequired(boolean isRequired)
Description copied from interface:DocumentDataMatchUIOptionsIf set to true, user won't be able to finish the scanning process if data read from front and back sides doesn't match. This is applicable only when using combined recognizers.- Specified by:
setDocumentDataMatchRequiredin interfaceDocumentDataMatchUIOptions- Parameters:
isRequired-trueif you wish to enable document data matching
-
setShowNotSupportedDialog
public void setShowNotSupportedDialog(boolean showNotSupportedDialog)
Description copied from interface:DocumentNotSupportedDialogUIOptionsDefines whether Document Not Supported dialog will be displayed in UI, default istrue.- Specified by:
setShowNotSupportedDialogin interfaceDocumentNotSupportedDialogUIOptions- Parameters:
showNotSupportedDialog- whether Document Not Supported dialog will be displayed in UI.
-
setShowFlashlightWarning
public void setShowFlashlightWarning(boolean showFlashlightWarning)
Description copied from interface:FlashlightWarningUIOptionsDefines whether flashlight warning will be displayed in UI, when flashlight is turned ON. Default istrue.- Specified by:
setShowFlashlightWarningin interfaceFlashlightWarningUIOptions- Parameters:
showFlashlightWarning- whether flashlight warning will be displayed in UI.
-
getShowFlashlightWarning
protected boolean getShowFlashlightWarning()
-
enableHighResSuccessFrameCapture
public void enableHighResSuccessFrameCapture(boolean enabled)
Description copied from interface:HighResSuccessFrameCaptureUIOptionsSets whether to enable capturing high res frames on recognition success. Default isfalse.- Specified by:
enableHighResSuccessFrameCapturein interfaceHighResSuccessFrameCaptureUIOptions- Parameters:
enabled-trueif you wish to enable high res success frame capture
-
setShowMrzDetection
public void setShowMrzDetection(boolean showOcrResult)
Description copied from interface:MrzDetectionUIOptionsDefines whether detection of MRZ(Machine Readable Zone) will be displayed in UI, default istrue.- Specified by:
setShowMrzDetectionin interfaceMrzDetectionUIOptions- Parameters:
showOcrResult- whether detection of MRZ(Machine Readable Zone) will be displayed in UI.
-
setOcrResultDisplayMode
public void setOcrResultDisplayMode(@Nullable OcrResultDisplayMode ocrResultDisplayMode)Description copied from interface:OcrResultDisplayUIOptionsDefines mode in which OCR result will be drawn on camera preview.- Specified by:
setOcrResultDisplayModein interfaceOcrResultDisplayUIOptions- Parameters:
ocrResultDisplayMode- mode in which OCR result will be drawn on camera preview.
-
setSplashScreenLayoutResourceID
public void setSplashScreenLayoutResourceID(int splashScreenLayoutResourceID)
Description copied from interface:SplashScreenUIOptionsDefines the ID of the layout resource that will be used as camera splash screen displayed while camera is being initialized. If not set, default splash screen will be used.- Specified by:
setSplashScreenLayoutResourceIDin interfaceSplashScreenUIOptions- Parameters:
splashScreenLayoutResourceID- ID of the layout resource that will be used as camera splash screen displayed while camera is being initialized.
-
getStrings
@Nullable protected DocumentVerificationStrings getStrings()
-
setStrings
public void setStrings(@NonNull DocumentVerificationStrings strings)Description copied from interface:StringsUIOptionsSets strings that will be used in the UI.- Specified by:
setStringsin interfaceStringsUIOptions<DocumentVerificationStrings>
-
setShowHoldInHandDialog
public void setShowHoldInHandDialog(boolean showHoldInHandDialog)
Defines whether camera overlay will show a dialog with instructions to hold the document in hand at the beginning of the scanning process. Default istrue.- Parameters:
showHoldInHandDialog- whether "hold in hand" dialog will be displayed in UI.
-
setTiltStartTimeIntervalMs
public void setTiltStartTimeIntervalMs(long tiltStartTimeInterval)
Sets time interval between neutral tilt step and first tilt step (left, right, top or down). By default, this is set toDocumentVerificationOverlaySettingsOptions.DEFAULT_TILT_START_TIME_INTERVAL_MS.- Parameters:
tiltStartTimeInterval- time interval between neutral tilt step and first tilt step.
-
setTiltStepTimeoutIntervalMs
public void setTiltStepTimeoutIntervalMs(long tiltStepTimeoutInterval)
Sets timeout interval for each tilt step. To disable the timeout, set it toDocumentVerificationOverlaySettingsOptions.TIME_INFINITY. By default, this is set toDocumentVerificationOverlaySettingsOptions.DEFAULT_TILT_STEP_TIMEOUT_INTERVAL_MS.- Parameters:
tiltStepTimeoutInterval- timeout interval for each tilt step.
-
setShowTooltipTimeIntervalMs
public void setShowTooltipTimeIntervalMs(long showTooltipTimeIntervalMs)
Sets time interval between the start of the tilt step and displaying the help tooltip. Help tooltip is displayed only once. By default, this is set toDocumentVerificationOverlaySettingsOptions.DEFAULT_SHOW_TOOLTIP_TIME_INTERVAL_MS.- Parameters:
showTooltipTimeIntervalMs- time interval between the start of the tilt step and displaying the help tooltip.
-
setKeepScreenOn
public void setKeepScreenOn(boolean keepScreenOn)
Defines whether system timeout will be disabled and screen kept always ON while scanning document. Default isfalse.- Parameters:
keepScreenOn- whether system timeout will be disabled and screen kept always ON.
-
shouldKeepScreenOn
protected boolean shouldKeepScreenOn()
-
setDocumentTypeUi
public void setDocumentTypeUi(DocumentTypeUi documentTypeUi)
Sets document type for the onboarding and info screen UI.- Parameters:
documentTypeUi- type of the document.
-
getTargetActivity
@NonNull public java.lang.Class<?> getTargetActivity()
Description copied from class:UISettingsReturns target activity. Concrete settings can be used only with the corresponding activity. This method is public for convenience when you are not able to useActivityRunner. DO NOT USE THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING. Improper usage will crash your app.- Specified by:
getTargetActivityin classUISettings<DocumentVerificationOverlayController>- Returns:
- target activity.
-
createOverlayController
@NonNull public DocumentVerificationOverlayController createOverlayController(@NonNull android.app.Activity activity, @NonNull ScanResultListener scanResultListener)
Description copied from class:UISettingsCreates overlay controller and configures it using set values.- Specified by:
createOverlayControllerin classUISettings<DocumentVerificationOverlayController>
-
createOverlaySettings
@NonNull protected DocumentVerificationOverlaySettings createOverlaySettings(android.content.Context context)
-
-