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.void
enableHighResSuccessFrameCapture
(boolean enabled) Sets whether to enable capturing high res frames on recognition success.getEditScreenStrings
(android.content.Context context) int
Returns theRecognizerBundle
containing recognizers that will be used for processing.long
Class<?>
Returns target activity.boolean
Returns whether edit scan results screen will be shown after scanning.protected boolean
void
saveToIntent
(android.content.Intent intent) Saves this scan activity settings toIntent
so it can be passed to the corresponding scan activity.void
setBackSideScanningTimeoutMs
(long backSideScanningTimeoutMs) void
setBeepSoundResourceID
(int beepSoundResourceID) Defines the resource ID of the sound to be played when recognition is successful.void
setCurrentImageListener
(CurrentImageListener currentImageListener) Sets implementation ofCurrentImageListener
interface that will obtain images that are currently being processed.void
setDebugImageListener
(DebugImageListener debugImageListener) Sets implementation ofDebugImageListener
interface that will obtain images that are being processed.void
setEditScreenEnabled
(boolean enabled) If set to true, additional screen that allows user to edit scan results will be show after scanning.void
setEditScreenFieldConfiguration
(BlinkCardEditFieldConfiguration fieldConfiguration) Configures which fields are available on edit scan results screen.void
setEditScreenStrings
(BlinkCardEditStrings strings) Sets strings that will be used in edit scan results screen.void
setEditScreenTheme
(int editScreenResourceID) Provide your own theme to style edit screen.void
setOcrResultDisplayMode
(OcrResultDisplayMode ocrResultDisplayMode) Defines mode in which OCR result will be drawn on camera preview.void
setOverlayViewStyle
(int styleResourceID) Provide your own style to replace default icons and colors.void
setShowGlareWarning
(boolean showFlashlightWarning) Defines whether glare warning will be displayed in UI, when flashlight is turned ON.void
setShowIntroductionDialog
(boolean showIntroductionDialog) void
setShowOnboardingInfo
(boolean showOnboardingInfo) void
setShowTooltipTimeIntervalMs
(long showTooltipTimeIntervalMs) void
setSplashScreenLayoutResourceID
(int splashScreenLayoutResourceID) Defines the ID of the layout resource that will be used as camera splash screen displayed while camera is being initialized.void
setStrings
(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 theRecognizerBundle
containing recognizers that will be used for processing.- Returns:
- the
RecognizerBundle
containing 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:
setOverlayViewStyle
in interfaceStyleUIOptions
- Parameters:
styleResourceID
- your style
-
setStrings
Sets strings that will be used in the UI.- Specified by:
setStrings
in interfaceStringsUIOptions<BlinkCardReticleOverlayStrings>
- Parameters:
strings
- strings that will be used
-
setBeepSoundResourceID
public void setBeepSoundResourceID(@RawRes int beepSoundResourceID) Description copied from interface:BeepSoundUIOptions
Defines the resource ID of the sound to be played when recognition is successful.- Specified by:
setBeepSoundResourceID
in interfaceBeepSoundUIOptions
- Parameters:
beepSoundResourceID
- resource ID of the sound to be played when recognition is successful.
-
setDebugImageListener
Description copied from interface:DebugImageListenerUIOptions
Sets implementation ofDebugImageListener
interface that will obtain images that are being processed. DebugImageListener will receive all possible debug images that become available during recognition process.- Specified by:
setDebugImageListener
in interfaceDebugImageListenerUIOptions
- Parameters:
debugImageListener
- Implementation of debug image listener ornull
to clear listener that has been set previously.
-
setCurrentImageListener
Description copied from interface:CurrentImageListenerUIOptions
Sets implementation ofCurrentImageListener
interface that will obtain images that are currently being processed.CurrentImageListener
will receive all possible images that become available during recognition process.- Specified by:
setCurrentImageListener
in interfaceCurrentImageListenerUIOptions
- Parameters:
currentImageListener
- Implementation of image listener ornull
to clear listener that has been set previously.
-
enableHighResSuccessFrameCapture
public void enableHighResSuccessFrameCapture(boolean enabled) Description copied from interface:HighResSuccessFrameCaptureUIOptions
Sets whether to enable capturing high res frames on recognition success. Default isfalse
.- Specified by:
enableHighResSuccessFrameCapture
in interfaceHighResSuccessFrameCaptureUIOptions
- Parameters:
enabled
-true
if you wish to enable high res success frame capture
-
setSplashScreenLayoutResourceID
public void setSplashScreenLayoutResourceID(int splashScreenLayoutResourceID) Description copied from interface:SplashScreenUIOptions
Defines 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:
setSplashScreenLayoutResourceID
in 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:OcrResultDisplayUIOptions
Defines mode in which OCR result will be drawn on camera preview.- Specified by:
setOcrResultDisplayMode
in 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:UISettings
Returns 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:
getTargetActivity
in classUISettings<BlinkCardOverlayController>
- Returns:
- target activity.
-
saveToIntent
@CallSuper public void saveToIntent(@NonNull android.content.Intent intent) Description copied from class:UISettings
Saves this scan activity settings toIntent
so 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:
saveToIntent
in 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:UISettings
Creates overlay controller and configures it using set values.- Specified by:
createOverlayController
in classUISettings<BlinkCardOverlayController>
-