Package com.microblink.blinkid.fragment.overlay.blinkid.reticleui

# Class ReticleOverlayView

java.lang.Object
com.microblink.blinkid.fragment.overlay.blinkid.reticleui.ReticleOverlayView

All Implemented Interfaces:
  `BlinkIdOverlayView`

public class ReticleOverlayView extends Object implements BlinkIdOverlayView

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.microblink.blinkid.fragment.overlay.blinkid.BlinkIdOverlayView

  `BlinkIdOverlayView.ProcessingError`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected ReticleUiState`
  `currentState`
  `protected String`
  `mandatoryFieldsMissingTooltipText`
  `protected ReticleOverlayStrings`
  `strings`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReticleOverlayView(boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, boolean shouldShowIntroductionDialog, boolean shouldShowOnboardingInfo, boolean shouldShowMandatoryFieldsMissing, boolean shouldAllowHapticFeedback, ReticleOverlayStrings strings, int style, boolean shouldShowTorchButton, boolean shouldShowCancelButton)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `changeState(ReticleUiState newState, String statusMessage)`
  `void`
  `changeStateIfRequired(ReticleUiState newState, String statusMessage)`
  `void`
  `cleanup()`
  Clean up your resources here.
  `android.view.ViewGroup`
  `createLayout(android.app.Activity activity, RecognizerRunnerView recognizerRunnerView)`
  Inflate your custom layout here and add it to the parent view
  `TorchController`
  `createTorchController(RecognizerRunnerView recognizerRunnerView)`
  Return properly set-up torch controller or null if torch is handled by the activity.
  `protected long`
  `currentStateDuration()`
  `protected android.util.Pair<ReticleUiState,String>`
  `detectionStatusToReticleState(DetectionStatus detectionStatus)`
  `RetryDialogStrings`
  `getDataMismatchStrings()`
  `RetryDialogStrings`
  `getDocumentNotSupportedDialogStrings()`
  `OnboardingView`
  `getOnboardingView()`
  `RetryDialogStrings`
  `getRecognitionTimeoutDialogStrings()`
  `RetryDialogStrings`
  `getSidesNotMatchingDialogStrings()`
  `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`
  `onDocumentClassified()`
  Called when document is successfully classified and recognition starts.
  `void`
  `onErrorDialogShown()`
  Called when error dialog is shown.
  `void`
  `onFirstSideScanStarted()`
  Called when scanning of the first side starts.
  `void`
  `onFirstSideScanSuccess(boolean isPassportScan, CardRotation cardRotation)`
  Called when scanning of the first side finishes successfully.
  `void`
  `onGlare(boolean hasGlare)`
  Called on glare detection update.
  `void`
  `onMovingCloserToBarcodeRequired()`
  Called when user should be instructed to move closer to barcode.
  `void`
  `onProcessingError(BlinkIdOverlayView.ProcessingError processingError)`
  Called when processing error, which should be displayed to the user, occurs.
  `long`
  `onScanSuccess()`
  Called when both sides are scanned.
  `void`
  `onSecondSideScanStarted()`
  Called when scanning of the second side starts.
  `void`
  `onTorchStateChanged(boolean torchOn)`
  Called when torch (flashlight) state is updated.
  `protected void`
  `reticleOverlayStringsSetup(android.app.Activity activity)`
  `void`
  `setMandatoryFieldsMissingTooltipText(int[] stringRes, android.app.Activity activity)`
  `void`
  `setRecognizerSupportsClassification(boolean isClassificationSupported)`
  If true, this means that recognizer supports classification and `BlinkIdOverlayView.onDocumentClassified()` will be called when the document is classified.
  `void`
  `setScanRecognitionModeOverlay(ScanRecognitionMode scanRecognitionMode)`
  Sets recognition mode used for onboarding overlay resources selection.
  `void`
  `setShowBackSideBarcodeInstructions(boolean shouldShow)`
  Set whether to show additional instructions when scanning back side of the document instructing user to scan the barcode.
  `protected boolean`
  `shouldStayInCurrentState(ReticleUiState newState)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### strings

    protected ReticleOverlayStrings strings

  - ### mandatoryFieldsMissingTooltipText

    protected String mandatoryFieldsMissingTooltipText

  - ### currentState

    protected ReticleUiState currentState

- ## Constructor Details

  - ### ReticleOverlayView

    public ReticleOverlayView(@Deprecated boolean shouldShowControlButtons, boolean shouldShowFlashlightWarning, boolean shouldShowIntroductionDialog, boolean shouldShowOnboardingInfo, boolean shouldShowMandatoryFieldsMissing, boolean shouldAllowHapticFeedback, @Nullable ReticleOverlayStrings strings, @StyleRes int style, boolean shouldShowTorchButton, boolean shouldShowCancelButton)

- ## Method Details

  - ### getOnboardingView

    public OnboardingView getOnboardingView()
    Specified by:
      `getOnboardingView` in interface `BlinkIdOverlayView`

  - ### createLayout

    public android.view.ViewGroup createLayout(@NonNull android.app.Activity activity, @NonNull RecognizerRunnerView recognizerRunnerView)
    Description copied from interface: `BlinkIdOverlayView`
    Inflate your custom layout here and add it to the parent view
    Specified by:
      `createLayout` in interface `BlinkIdOverlayView`
    Parameters:
      `activity` - current activity
      `recognizerRunnerView` - 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: `BlinkIdOverlayView`
    Called when host's screen orientation is changed.
    Specified by:
      `onConfigurationChanged` in interface `BlinkIdOverlayView`
    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: `BlinkIdOverlayView`
    Return properly set-up torch controller or null if torch is handled by the activity.
    Specified by:
      `createTorchController` in interface `BlinkIdOverlayView`
    Parameters:
      `recognizerRunnerView` - required for torch controller setup
    Returns:
      torch controller

  - ### onFirstSideScanStarted

    @CallSuper public void onFirstSideScanStarted()
    Description copied from interface: `BlinkIdOverlayView`
    Called when scanning of the first side starts.
    Specified by:
      `onFirstSideScanStarted` in interface `BlinkIdOverlayView`

  - ### onFirstSideScanSuccess

    public void onFirstSideScanSuccess(boolean isPassportScan, CardRotation cardRotation)
    Description copied from interface: `BlinkIdOverlayView`
    Called when scanning of the first side finishes successfully.
    Specified by:
      `onFirstSideScanSuccess` in interface `BlinkIdOverlayView`

  - ### onSecondSideScanStarted

    public void onSecondSideScanStarted()
    Description copied from interface: `BlinkIdOverlayView`
    Called when scanning of the second side starts.
    Specified by:
      `onSecondSideScanStarted` in interface `BlinkIdOverlayView`

  - ### onMovingCloserToBarcodeRequired

    public void onMovingCloserToBarcodeRequired()
    Description copied from interface: `BlinkIdOverlayView`
    Called when user should be instructed to move closer to barcode.
    Specified by:
      `onMovingCloserToBarcodeRequired` in interface `BlinkIdOverlayView`

  - ### setRecognizerSupportsClassification

    public void setRecognizerSupportsClassification(boolean isClassificationSupported)
    Description copied from interface: `BlinkIdOverlayView`
    If true, this means that recognizer supports classification and `BlinkIdOverlayView.onDocumentClassified()` will be called when the document is classified.
    Specified by:
      `setRecognizerSupportsClassification` in interface `BlinkIdOverlayView`
    Parameters:
      `isClassificationSupported` - true if classification is supported

  - ### onScanSuccess

    public long onScanSuccess()
    Description copied from interface: `BlinkIdOverlayView`
    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 interface `BlinkIdOverlayView`
    Returns:
      delay in milliseconds

  - ### onCardDetectionUpdate

    public void onCardDetectionUpdate(@NonNull DetectionStatus detectionStatus)
    Description copied from interface: `BlinkIdOverlayView`
    Called on any update to card detection process.
    Specified by:
      `onCardDetectionUpdate` in interface `BlinkIdOverlayView`

  - ### reticleOverlayStringsSetup

    protected void reticleOverlayStringsSetup(android.app.Activity activity)

  - ### detectionStatusToReticleState

    protected android.util.Pair<ReticleUiState,String> detectionStatusToReticleState(DetectionStatus detectionStatus)

  - ### onProcessingError

    public void onProcessingError(@NonNull BlinkIdOverlayView.ProcessingError processingError)
    Description copied from interface: `BlinkIdOverlayView`
    Called when processing error, which should be displayed to the user, occurs.
    Specified by:
      `onProcessingError` in interface `BlinkIdOverlayView`
    Parameters:
      `processingError` - processing error type.

  - ### onErrorDialogShown

    public void onErrorDialogShown()
    Description copied from interface: `BlinkIdOverlayView`
    Called when error dialog is shown. Make sure to stop animations here.
    Specified by:
      `onErrorDialogShown` in interface `BlinkIdOverlayView`

  - ### onGlare

    public void onGlare(boolean hasGlare)
    Description copied from interface: `BlinkIdOverlayView`
    Called on glare detection update.
    Specified by:
      `onGlare` in interface `BlinkIdOverlayView`
    Parameters:
      `hasGlare` - true if glare detected

  - ### onTorchStateChanged

    public void onTorchStateChanged(boolean torchOn)
    Description copied from interface: `BlinkIdOverlayView`
    Called when torch (flashlight) state is updated.
    Specified by:
      `onTorchStateChanged` in interface `BlinkIdOverlayView`
    Parameters:
      `torchOn` - `true` if torch is turned on, `false` otherwise.

  - ### cleanup

    public void cleanup()
    Description copied from interface: `BlinkIdOverlayView`
    Clean up your resources here.
    Specified by:
      `cleanup` in interface `BlinkIdOverlayView`

  - ### setScanRecognitionModeOverlay

    public void setScanRecognitionModeOverlay(ScanRecognitionMode scanRecognitionMode)
    Description copied from interface: `BlinkIdOverlayView`
    Sets recognition mode used for onboarding overlay resources selection.
    Specified by:
      `setScanRecognitionModeOverlay` in interface `BlinkIdOverlayView`
    Parameters:
      `scanRecognitionMode` - required for onboarding overlay resources selection

  - ### getDocumentNotSupportedDialogStrings

    @NonNull public RetryDialogStrings getDocumentNotSupportedDialogStrings()
    Specified by:
      `getDocumentNotSupportedDialogStrings` in interface `BlinkIdOverlayView`
    Returns:
      strings to be used for error dialog shown when document is not supported

  - ### getRecognitionTimeoutDialogStrings

    @NonNull public RetryDialogStrings getRecognitionTimeoutDialogStrings()
    Specified by:
      `getRecognitionTimeoutDialogStrings` in interface `BlinkIdOverlayView`
    Returns:
      strings to be used for error dialog shown when second document side can't be recognized

  - ### getSidesNotMatchingDialogStrings

    @NonNull public RetryDialogStrings getSidesNotMatchingDialogStrings()
    Specified by:
      `getSidesNotMatchingDialogStrings` in interface `BlinkIdOverlayView`
    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:
      `getDataMismatchStrings` in interface `BlinkIdOverlayView`
    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: `BlinkIdOverlayView`
    Set whether to show additional instructions when scanning back side of the document instructing user to scan the barcode.
    Specified by:
      `setShowBackSideBarcodeInstructions` in interface `BlinkIdOverlayView`
    Parameters:
      `shouldShow` - true if barcode instructions should be shown

  - ### onDocumentClassified

    public void onDocumentClassified()
    Description copied from interface: `BlinkIdOverlayView`
    Called when document is successfully classified and recognition starts.
    Specified by:
      `onDocumentClassified` in interface `BlinkIdOverlayView`

  - ### changeStateIfRequired

    public void changeStateIfRequired(@NonNull ReticleUiState newState, String statusMessage)

  - ### changeState

    public void changeState(@NonNull ReticleUiState newState, String statusMessage)

  - ### shouldStayInCurrentState

    protected boolean shouldStayInCurrentState(ReticleUiState newState)

  - ### setMandatoryFieldsMissingTooltipText

    public void setMandatoryFieldsMissingTooltipText(int[] stringRes, android.app.Activity activity)
    Specified by:
      `setMandatoryFieldsMissingTooltipText` in interface `BlinkIdOverlayView`

  - ### currentStateDuration

    protected long currentStateDuration()