Class ReticleOverlayView
- java.lang.Object
-
- com.microblink.documentverification.fragment.overlay.blinkid.reticleui.ReticleOverlayView
-
- All Implemented Interfaces:
BlinkIdOverlayView
- Direct Known Subclasses:
ReticleDocumentVerificationOverlayView
public class ReticleOverlayView extends java.lang.Object implements BlinkIdOverlayView
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microblink.documentverification.fragment.overlay.blinkid.BlinkIdOverlayView
BlinkIdOverlayView.ProcessingError
-
-
Field Summary
Fields Modifier and Type Field Description protected ReticleUiStatecurrentStateprotected ReticleOverlayStringsstrings
-
Constructor Summary
Constructors Constructor Description ReticleOverlayView(boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, ReticleOverlayStrings strings, int style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeState(ReticleUiState newState, java.lang.String statusMessage)voidchangeStateIfRequired(ReticleUiState newState, java.lang.String statusMessage)voidcleanup()Clean up your resources here.android.view.ViewGroupcreateLayout(android.app.Activity activity, RecognizerRunnerView recognizerRunnerView)Inflate your custom layout here and add it to the parent viewTorchControllercreateTorchController(RecognizerRunnerView recognizerRunnerView)Return properly set-up torch controller or null if torch is handled by the activity.protected longcurrentStateDuration()protected android.util.Pair<ReticleUiState,java.lang.String>detectionStatusToReticleState(DetectionStatus detectionStatus)RetryDialogStringsgetDataMismatchStrings()RetryDialogStringsgetDocumentNotSupportedDialogStrings()RetryDialogStringsgetRecognitionTimeoutDialogStrings()RetryDialogStringsgetSidesNotMatchingDialogStrings()voidonCardDetectionUpdate(DetectionStatus detectionStatus)Called on any update to card detection process.voidonConfigurationChanged(int newHostScreenOrientation)Called when host's screen orientation is changed.voidonDocumentClassified()Called when document is successfully classified and recognition starts.voidonErrorDialogShown()Called when error dialog is shown.voidonFirstSideScanStarted()Called when scanning of the first side starts.voidonGlare(boolean hasGlare)Called on glare detection update.voidonMovingCloserToBarcodeRequired()Called when user should be instructed to move closer to barcode.voidonProcessingError(BlinkIdOverlayView.ProcessingError processingError)Called when processing error, which should be displayed to the user, occurs.longonScanSuccess()Called when both sides are scanned.voidonSecondSideScanStarted()Called when scanning of the second side starts.voidonTorchStateChanged(boolean torchOn)Called when torch (flashlight) state is updated.voidsetRecognizerSupportsClassification(boolean isClassificationSupported)If true, this means that recognizer supports classification andBlinkIdOverlayView.onDocumentClassified()will be called when the document is classified.voidsetShowBackSideBarcodeInstructions(boolean shouldShow)Set whether to show additional instructions when scanning back side of the document instructing user to scan the barcode.protected booleanshouldStayInCurrentState(ReticleUiState newState)
-
-
-
Field Detail
-
strings
protected ReticleOverlayStrings strings
-
currentState
protected ReticleUiState currentState
-
-
Constructor Detail
-
ReticleOverlayView
public ReticleOverlayView(boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, @Nullable ReticleOverlayStrings strings, @StyleRes int style)
-
-
Method Detail
-
createLayout
public android.view.ViewGroup createLayout(@NonNull android.app.Activity activity, @NonNull RecognizerRunnerView recognizerRunnerView)Description copied from interface:BlinkIdOverlayViewInflate your custom layout here and add it to the parent view- Specified by:
createLayoutin interfaceBlinkIdOverlayView- Parameters:
activity- current activityrecognizerRunnerView- root view to be used as inflation parent- Returns:
- root view group of your layout
-
onConfigurationChanged
public void onConfigurationChanged(int newHostScreenOrientation)
Description copied from interface:BlinkIdOverlayViewCalled when host's screen orientation is changed.- Specified by:
onConfigurationChangedin interfaceBlinkIdOverlayView- Parameters:
newHostScreenOrientation- orientation code, possible values are: ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE and ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
-
createTorchController
@NonNull public TorchController createTorchController(@NonNull RecognizerRunnerView recognizerRunnerView)
Description copied from interface:BlinkIdOverlayViewReturn properly set-up torch controller or null if torch is handled by the activity.- Specified by:
createTorchControllerin interfaceBlinkIdOverlayView- Parameters:
recognizerRunnerView- required for torch controller setup- Returns:
- torch controller
-
onFirstSideScanStarted
@CallSuper public void onFirstSideScanStarted()
Description copied from interface:BlinkIdOverlayViewCalled when scanning of the first side starts.- Specified by:
onFirstSideScanStartedin interfaceBlinkIdOverlayView
-
onSecondSideScanStarted
public void onSecondSideScanStarted()
Description copied from interface:BlinkIdOverlayViewCalled when scanning of the second side starts.- Specified by:
onSecondSideScanStartedin interfaceBlinkIdOverlayView
-
onMovingCloserToBarcodeRequired
public void onMovingCloserToBarcodeRequired()
Description copied from interface:BlinkIdOverlayViewCalled when user should be instructed to move closer to barcode.- Specified by:
onMovingCloserToBarcodeRequiredin interfaceBlinkIdOverlayView
-
setRecognizerSupportsClassification
public void setRecognizerSupportsClassification(boolean isClassificationSupported)
Description copied from interface:BlinkIdOverlayViewIf true, this means that recognizer supports classification andBlinkIdOverlayView.onDocumentClassified()will be called when the document is classified.- Specified by:
setRecognizerSupportsClassificationin interfaceBlinkIdOverlayView- Parameters:
isClassificationSupported- true if classification is supported
-
onScanSuccess
public long onScanSuccess()
Description copied from interface:BlinkIdOverlayViewCalled when both sides are scanned. If you wish to animate success state, return delay in milliseconds and overlay controller will wait before reporting that scanning is done.- Specified by:
onScanSuccessin interfaceBlinkIdOverlayView- Returns:
- delay in milliseconds
-
onCardDetectionUpdate
public void onCardDetectionUpdate(@NonNull DetectionStatus detectionStatus)Description copied from interface:BlinkIdOverlayViewCalled on any update to card detection process.- Specified by:
onCardDetectionUpdatein interfaceBlinkIdOverlayView
-
detectionStatusToReticleState
protected android.util.Pair<ReticleUiState,java.lang.String> detectionStatusToReticleState(DetectionStatus detectionStatus)
-
onProcessingError
public void onProcessingError(@NonNull BlinkIdOverlayView.ProcessingError processingError)Description copied from interface:BlinkIdOverlayViewCalled when processing error, which should be displayed to the user, occurs.- Specified by:
onProcessingErrorin interfaceBlinkIdOverlayView- Parameters:
processingError- processing error type.
-
onErrorDialogShown
public void onErrorDialogShown()
Description copied from interface:BlinkIdOverlayViewCalled when error dialog is shown. Make sure to stop animations here.- Specified by:
onErrorDialogShownin interfaceBlinkIdOverlayView
-
onGlare
public void onGlare(boolean hasGlare)
Description copied from interface:BlinkIdOverlayViewCalled on glare detection update.- Specified by:
onGlarein interfaceBlinkIdOverlayView- Parameters:
hasGlare- true if glare detected
-
onTorchStateChanged
public void onTorchStateChanged(boolean torchOn)
Description copied from interface:BlinkIdOverlayViewCalled when torch (flashlight) state is updated.- Specified by:
onTorchStateChangedin interfaceBlinkIdOverlayView- Parameters:
torchOn-trueif torch is turned on,falseotherwise.
-
cleanup
public void cleanup()
Description copied from interface:BlinkIdOverlayViewClean up your resources here.- Specified by:
cleanupin interfaceBlinkIdOverlayView
-
getDocumentNotSupportedDialogStrings
@NonNull public RetryDialogStrings getDocumentNotSupportedDialogStrings()
- Specified by:
getDocumentNotSupportedDialogStringsin interfaceBlinkIdOverlayView- Returns:
- strings to be used for error dialog shown when document is not supported
-
getRecognitionTimeoutDialogStrings
@NonNull public RetryDialogStrings getRecognitionTimeoutDialogStrings()
- Specified by:
getRecognitionTimeoutDialogStringsin interfaceBlinkIdOverlayView- Returns:
- strings to be used for error dialog shown when second document side can't be recognized
-
getSidesNotMatchingDialogStrings
@NonNull public RetryDialogStrings getSidesNotMatchingDialogStrings()
- Specified by:
getSidesNotMatchingDialogStringsin interfaceBlinkIdOverlayView- Returns:
- strings to be used for error dialog shown when data from the second document side doesn't match the data from the first side
-
getDataMismatchStrings
@NonNull public RetryDialogStrings getDataMismatchStrings()
- Specified by:
getDataMismatchStringsin interfaceBlinkIdOverlayView- Returns:
- strings to be used for error dialog shown when scanned document has data mismatch
-
setShowBackSideBarcodeInstructions
public void setShowBackSideBarcodeInstructions(boolean shouldShow)
Description copied from interface:BlinkIdOverlayViewSet whether to show additional instructions when scanning back side of the document instructing user to scan the barcode.- Specified by:
setShowBackSideBarcodeInstructionsin interfaceBlinkIdOverlayView- Parameters:
shouldShow- true if barcode instructions should be shown
-
onDocumentClassified
public void onDocumentClassified()
Description copied from interface:BlinkIdOverlayViewCalled when document is successfully classified and recognition starts.- Specified by:
onDocumentClassifiedin interfaceBlinkIdOverlayView
-
changeStateIfRequired
public void changeStateIfRequired(@NonNull ReticleUiState newState, java.lang.String statusMessage)
-
changeState
public void changeState(@NonNull ReticleUiState newState, java.lang.String statusMessage)
-
shouldStayInCurrentState
protected boolean shouldStayInCurrentState(ReticleUiState newState)
-
currentStateDuration
protected long currentStateDuration()
-
-