Class BlinkCardReticleOverlayView
java.lang.Object
com.microblink.blinkcard.fragment.overlay.blinkcard.reticleui.BlinkCardReticleOverlayView
- All Implemented Interfaces:
BlinkCardOverlayView
-
Field Summary
Modifier and TypeFieldDescriptionprotected BlinkCardReticleUiState
protected BlinkCardReticleOverlayStrings
-
Constructor Summary
ConstructorDescriptionBlinkCardReticleOverlayView
(boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, boolean shouldShowIntroductionDialog, boolean shouldShowOnboardingInfo, BlinkCardReticleOverlayStrings strings, int style) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
changeState
(BlinkCardReticleUiState newState, String statusMessage) void
changeStateIfRequired
(BlinkCardReticleUiState newState, String statusMessage) void
cleanup()
Clean up your resources here.android.view.ViewGroup
createLayout
(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 long
protected android.util.Pair<BlinkCardReticleUiState,
String> detectionStatusToReticleState
(DetectionStatus detectionStatus) void
Manual entry button should be disabled/hidden from the UI.void
enableManualEntryButton
(android.view.View.OnClickListener onClickListener) Manual entry button should be enabled/shown in the UI.void
onCardDetectionUpdate
(DetectionStatus detectionStatus) Called on any update to card detection process.void
onConfigurationChanged
(int newHostScreenOrientation) Called when host's screen orientation is changed.void
Called when error dialog is shown.void
Called when scanning of the first side starts.void
Called after each frame has been processedlong
Called when both sides are scanned.void
Called when scanning of the second side starts.void
onTorchStateChanged
(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:
getOnboardingView
in interfaceBlinkCardOverlayView
-
createLayout
@NonNull public android.view.ViewGroup createLayout(@NonNull android.app.Activity activity, @NonNull RecognizerRunnerView recognizerRunnerView) Description copied from interface:BlinkCardOverlayView
Inflate your custom layout layout here- Specified by:
createLayout
in interfaceBlinkCardOverlayView
- Parameters:
activity
- current activity- Returns:
- root view of your custom layout
-
onConfigurationChanged
public void onConfigurationChanged(int newHostScreenOrientation) Description copied from interface:BlinkCardOverlayView
Called when host's screen orientation is changed.- Specified by:
onConfigurationChanged
in 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:BlinkCardOverlayView
Return properly set-up torch controller or null if torch is handled by the activity.- Specified by:
createTorchController
in interfaceBlinkCardOverlayView
- Parameters:
recognizerRunnerView
- required for torch controller setup- Returns:
- torch controller
-
onFirstSideScanStarted
@CallSuper public void onFirstSideScanStarted()Description copied from interface:BlinkCardOverlayView
Called when scanning of the first side starts.- Specified by:
onFirstSideScanStarted
in interfaceBlinkCardOverlayView
-
onSecondSideScanStarted
public void onSecondSideScanStarted()Description copied from interface:BlinkCardOverlayView
Called when scanning of the second side starts.- Specified by:
onSecondSideScanStarted
in interfaceBlinkCardOverlayView
-
getRecognitionTimeoutDialogStrings
- Specified by:
getRecognitionTimeoutDialogStrings
in 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:BlinkCardOverlayView
Manual entry button should be enabled/shown in the UI.- Specified by:
enableManualEntryButton
in interfaceBlinkCardOverlayView
- Parameters:
onClickListener
- listener to register to manual entry button
-
animateAndShowManualEntryButton
public void animateAndShowManualEntryButton() -
disableManualEntryButton
public void disableManualEntryButton()Description copied from interface:BlinkCardOverlayView
Manual entry button should be disabled/hidden from the UI.- Specified by:
disableManualEntryButton
in interfaceBlinkCardOverlayView
-
onScanSuccess
public long onScanSuccess()Description copied from interface:BlinkCardOverlayView
Called 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:
onScanSuccess
in interfaceBlinkCardOverlayView
- Returns:
- delay in milliseconds
-
onCardDetectionUpdate
Description copied from interface:BlinkCardOverlayView
Called on any update to card detection process.- Specified by:
onCardDetectionUpdate
in interfaceBlinkCardOverlayView
-
onFrameProcessingStatus
Description copied from interface:BlinkCardOverlayView
Called after each frame has been processed- Specified by:
onFrameProcessingStatus
in 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:BlinkCardOverlayView
Called when error dialog is shown. Make sure to stop animations here.- Specified by:
onErrorDialogShown
in interfaceBlinkCardOverlayView
-
onTorchStateChanged
public void onTorchStateChanged(boolean torchOn) Description copied from interface:BlinkCardOverlayView
Called when torch (flashlight) state is updated.- Specified by:
onTorchStateChanged
in interfaceBlinkCardOverlayView
- Parameters:
torchOn
-true
if torch is turned on,false
otherwise.
-
cleanup
public void cleanup()Description copied from interface:BlinkCardOverlayView
Clean up your resources here.- Specified by:
cleanup
in interfaceBlinkCardOverlayView
-
changeStateIfRequired
-
changeState
-
shouldStayInCurrentState
-
currentStateDuration
protected long currentStateDuration()
-