Class BlinkCardUISettings
java.lang.Object
com.microblink.blinkcard.uisettings.UISettings<BlinkCardOverlayController>
com.microblink.blinkcard.uisettings.BlinkCardUISettings
- All Implemented Interfaces:
BeepSoundUIOptions,CurrentImageListenerUIOptions,DebugImageListenerUIOptions,HighResSuccessFrameCaptureUIOptions,OcrResultDisplayUIOptions,SplashScreenUIOptions,StringsUIOptions<BlinkCardReticleOverlayStrings>,StyleUIOptions
public class BlinkCardUISettings
extends UISettings<BlinkCardOverlayController>
implements BeepSoundUIOptions, DebugImageListenerUIOptions, CurrentImageListenerUIOptions, HighResSuccessFrameCaptureUIOptions, SplashScreenUIOptions, OcrResultDisplayUIOptions, StyleUIOptions, StringsUIOptions<BlinkCardReticleOverlayStrings>
-
Constructor Summary
ConstructorsConstructorDescriptionBlinkCardUISettings(android.content.Intent intent) BlinkCardUISettings(RecognizerBundle recognizerBundle) -
Method Summary
Modifier and TypeMethodDescriptioncreateOverlayController(android.app.Activity activity, ScanResultListener scanResultListener) Creates overlay controller and configures it using set values.voidenableHighResSuccessFrameCapture(boolean enabled) Sets whether to enable capturing high res frames on recognition success.getEditScreenStrings(android.content.Context context) intReturns theRecognizerBundlecontaining recognizers that will be used for processing.longClass<?>Returns target activity.booleanReturns whether edit scan results screen will be shown after scanning.protected booleanvoidsaveToIntent(android.content.Intent intent) Saves this scan activity settings toIntentso it can be passed to the corresponding scan activity.voidsetBackSideScanningTimeoutMs(long backSideScanningTimeoutMs) 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.voidsetEditScreenEnabled(boolean enabled) If set to true, additional screen that allows user to edit scan results will be show after scanning.voidsetEditScreenFieldConfiguration(BlinkCardEditFieldConfiguration fieldConfiguration) Configures which fields are available on edit scan results screen.voidsetEditScreenStrings(BlinkCardEditStrings strings) Sets strings that will be used in edit scan results screen.voidsetEditScreenTheme(int editScreenResourceID) Provide your own theme to style edit screen.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.voidsetShowGlareWarning(boolean showFlashlightWarning) Defines whether glare warning will be displayed in UI, when flashlight is turned ON.voidsetShowIntroductionDialog(boolean showIntroductionDialog) voidsetShowOnboardingInfo(boolean showOnboardingInfo) voidsetShowTooltipTimeIntervalMs(long showTooltipTimeIntervalMs) 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(BlinkCardReticleOverlayStrings strings) Sets strings that will be used in the UI.Methods inherited from class com.microblink.blinkcard.uisettings.UISettings
getActivityTheme, getFilterTouchesWhenObscured, getUsingFlagSecure, setActivityTheme, setCameraSettings, setFilterTouchesWhenObscured, setUsingFlagSecure
-
Constructor Details
-
BlinkCardUISettings
-
BlinkCardUISettings
public BlinkCardUISettings(@NonNull android.content.Intent intent)
-
-
Method Details
-
getRecognizerBundle
Returns theRecognizerBundlecontaining recognizers that will be used for processing.- Returns:
- the
RecognizerBundlecontaining recognizers that will be used for processing.
-
setOverlayViewStyle
public void setOverlayViewStyle(@StyleRes int styleResourceID) Provide your own style to replace default icons and colors. Supports attributes from R.styleable.BlinkCardReticleOverlay- Specified by:
setOverlayViewStylein interfaceStyleUIOptions- Parameters:
styleResourceID- your style
-
setStrings
Sets strings that will be used in the UI.- Specified by:
setStringsin interfaceStringsUIOptions<BlinkCardReticleOverlayStrings>- Parameters:
strings- strings that will be used
-
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.
-
setDebugImageListener
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.
-
setCurrentImageListener
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.
-
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
-
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.
-
setOcrResultDisplayMode
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.
-
setEditScreenEnabled
public void setEditScreenEnabled(boolean enabled) If set to true, additional screen that allows user to edit scan results will be show after scanning. -
isEditScreenEnabled
public boolean isEditScreenEnabled()Returns whether edit scan results screen will be shown after scanning.- Returns:
- true if edit screen is enabled
-
setEditScreenTheme
public void setEditScreenTheme(@StyleRes int editScreenResourceID) Provide your own theme to style edit screen. Either extend @style/MB_theme_blink_card_edit_screen or extend any AppCompat theme. If you don't extend our theme, make sure to provide all attributes from R.styleable.BlinkCardEditScreen.- Parameters:
editScreenResourceID- your theme
-
getEditScreenTheme
@StyleRes public int getEditScreenTheme() -
setEditScreenFieldConfiguration
Configures which fields are available on edit scan results screen.- Parameters:
fieldConfiguration- your configuration
-
getEditScreenFieldConfiguration
-
setEditScreenStrings
Sets strings that will be used in edit scan results screen.- Parameters:
strings- your custom strings
-
getEditScreenStrings
-
setShowGlareWarning
public void setShowGlareWarning(boolean showFlashlightWarning) Defines whether glare warning will be displayed in UI, when flashlight is turned ON. Default istrue.- Parameters:
showFlashlightWarning- whether glare warning will be displayed in UI.
-
setShowOnboardingInfo
public void setShowOnboardingInfo(boolean showOnboardingInfo) -
setShowIntroductionDialog
public void setShowIntroductionDialog(boolean showIntroductionDialog) -
setBackSideScanningTimeoutMs
public void setBackSideScanningTimeoutMs(long backSideScanningTimeoutMs) -
setShowTooltipTimeIntervalMs
public void setShowTooltipTimeIntervalMs(long showTooltipTimeIntervalMs) -
getShowTooltipTimeIntervalMs
public long getShowTooltipTimeIntervalMs() -
isLockedToPortrait
protected boolean isLockedToPortrait() -
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<BlinkCardOverlayController>- Returns:
- target activity.
-
saveToIntent
@CallSuper 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<BlinkCardOverlayController>- Parameters:
intent- Intent to which this scan activity settings should be saved.
-
createOverlayController
@NonNull public BlinkCardOverlayController 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<BlinkCardOverlayController>
-