Class BlinkCardReticleOverlayView
java.lang.Object
com.microblink.blinkcard.fragment.overlay.blinkcard.reticleui.BlinkCardReticleOverlayView
- All Implemented Interfaces:
BlinkCardOverlayView
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BlinkCardReticleUiStateprotected BlinkCardReticleOverlayStrings -
Constructor Summary
ConstructorsConstructorDescriptionBlinkCardReticleOverlayView(boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, boolean shouldShowIntroductionDialog, boolean shouldShowOnboardingInfo, BlinkCardReticleOverlayStrings strings, int style) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidchangeState(BlinkCardReticleUiState newState, String statusMessage) voidchangeStateIfRequired(BlinkCardReticleUiState newState, String statusMessage) voidcleanup()Clean up your resources here.android.view.ViewGroupcreateLayout(android.app.Activity activity, RecognizerRunnerView recognizerRunnerView) Inflate your custom layout layout herecreateTorchController(RecognizerRunnerView recognizerRunnerView) Return properly set-up torch controller or null if torch is handled by the activity.protected longprotected android.util.Pair<BlinkCardReticleUiState,String> detectionStatusToReticleState(DetectionStatus detectionStatus) voidManual entry button should be disabled/hidden from the UI.voidenableManualEntryButton(android.view.View.OnClickListener onClickListener) Manual entry button should be enabled/shown in the UI.voidonCardDetectionUpdate(DetectionStatus detectionStatus) Called on any update to card detection process.voidonConfigurationChanged(int newHostScreenOrientation) Called when host's screen orientation is changed.voidCalled when error dialog is shown.voidCalled when scanning of the first side starts.voidCalled after each frame has been processedlongCalled when both sides are scanned.voidCalled when scanning of the second side starts.voidonTorchStateChanged(boolean torchOn) Called when torch (flashlight) state is updated.protected boolean
-
Field Details
-
strings
-
currentState
-
-
Constructor Details
-
BlinkCardReticleOverlayView
public BlinkCardReticleOverlayView(boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, boolean shouldShowIntroductionDialog, boolean shouldShowOnboardingInfo, @Nullable BlinkCardReticleOverlayStrings strings, @StyleRes int style)
-
-
Method Details
-
getOnboardingView
- Specified by:
getOnboardingViewin interfaceBlinkCardOverlayView
-
createLayout
@NonNull public android.view.ViewGroup createLayout(@NonNull android.app.Activity activity, @NonNull RecognizerRunnerView recognizerRunnerView) Description copied from interface:BlinkCardOverlayViewInflate your custom layout layout here- Specified by:
createLayoutin interfaceBlinkCardOverlayView- Parameters:
activity- current activity- Returns:
- root view of your custom layout
-
onConfigurationChanged
public void onConfigurationChanged(int newHostScreenOrientation) Description copied from interface:BlinkCardOverlayViewCalled when host's screen orientation is changed.- Specified by:
onConfigurationChangedin interfaceBlinkCardOverlayView- 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:BlinkCardOverlayViewReturn properly set-up torch controller or null if torch is handled by the activity.- Specified by:
createTorchControllerin interfaceBlinkCardOverlayView- Parameters:
recognizerRunnerView- required for torch controller setup- Returns:
- torch controller
-
onFirstSideScanStarted
@CallSuper public void onFirstSideScanStarted()Description copied from interface:BlinkCardOverlayViewCalled when scanning of the first side starts.- Specified by:
onFirstSideScanStartedin interfaceBlinkCardOverlayView
-
onSecondSideScanStarted
public void onSecondSideScanStarted()Description copied from interface:BlinkCardOverlayViewCalled when scanning of the second side starts.- Specified by:
onSecondSideScanStartedin interfaceBlinkCardOverlayView
-
getRecognitionTimeoutDialogStrings
- Specified by:
getRecognitionTimeoutDialogStringsin interfaceBlinkCardOverlayView- Returns:
- strings to be used for error dialog shown when second document side can't be recognized
-
enableManualEntryButton
public void enableManualEntryButton(android.view.View.OnClickListener onClickListener) Description copied from interface:BlinkCardOverlayViewManual entry button should be enabled/shown in the UI.- Specified by:
enableManualEntryButtonin interfaceBlinkCardOverlayView- Parameters:
onClickListener- listener to register to manual entry button
-
animateAndShowManualEntryButton
public void animateAndShowManualEntryButton() -
disableManualEntryButton
public void disableManualEntryButton()Description copied from interface:BlinkCardOverlayViewManual entry button should be disabled/hidden from the UI.- Specified by:
disableManualEntryButtonin interfaceBlinkCardOverlayView
-
onScanSuccess
public long onScanSuccess()Description copied from interface:BlinkCardOverlayViewCalled 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 interfaceBlinkCardOverlayView- Returns:
- delay in milliseconds
-
onCardDetectionUpdate
Description copied from interface:BlinkCardOverlayViewCalled on any update to card detection process.- Specified by:
onCardDetectionUpdatein interfaceBlinkCardOverlayView
-
onFrameProcessingStatus
Description copied from interface:BlinkCardOverlayViewCalled after each frame has been processed- Specified by:
onFrameProcessingStatusin interfaceBlinkCardOverlayView- Parameters:
status- latest frame processing status
-
detectionStatusToReticleState
protected android.util.Pair<BlinkCardReticleUiState,String> detectionStatusToReticleState(DetectionStatus detectionStatus) -
onErrorDialogShown
public void onErrorDialogShown()Description copied from interface:BlinkCardOverlayViewCalled when error dialog is shown. Make sure to stop animations here.- Specified by:
onErrorDialogShownin interfaceBlinkCardOverlayView
-
onTorchStateChanged
public void onTorchStateChanged(boolean torchOn) Description copied from interface:BlinkCardOverlayViewCalled when torch (flashlight) state is updated.- Specified by:
onTorchStateChangedin interfaceBlinkCardOverlayView- Parameters:
torchOn-trueif torch is turned on,falseotherwise.
-
cleanup
public void cleanup()Description copied from interface:BlinkCardOverlayViewClean up your resources here.- Specified by:
cleanupin interfaceBlinkCardOverlayView
-
changeStateIfRequired
-
changeState
-
shouldStayInCurrentState
-
currentStateDuration
protected long currentStateDuration()
-