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

# Interface BlinkIdOverlayView

All Known Implementing Classes:
  `DocumentOverlayView`, `LegacyDocumentVerificationOverlayView`, `ReticleOverlayView`

public interface BlinkIdOverlayView

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static enum`
  `BlinkIdOverlayView.ProcessingError`
  Supported processing errors.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cleanup()`
  Clean up your resources here.
  `android.view.ViewGroup`
  `createLayout(android.app.Activity activity, RecognizerRunnerView parentView)`
  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.
  `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.
  `void`
  `setMandatoryFieldsMissingTooltipText(int[] stringRes, android.app.Activity activity)`
  `void`
  `setRecognizerSupportsClassification(boolean isClassificationSupported)`
  If true, this means that recognizer supports classification and `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.

- ## Method Details

  - ### createLayout

    android.view.ViewGroup createLayout(@NonNull android.app.Activity activity, @NonNull RecognizerRunnerView parentView)
    Inflate your custom layout here and add it to the parent view
    Parameters:
      `activity` - current activity
      `parentView` - root view to be used as inflation parent
    Returns:
      root view group of your layout

  - ### onConfigurationChanged

    void onConfigurationChanged(int newHostScreenOrientation)
    Called when host's screen orientation is changed.
    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 TorchController createTorchController(@NonNull RecognizerRunnerView recognizerRunnerView)
    Return properly set-up torch controller or null if torch is handled by the activity.
    Parameters:
      `recognizerRunnerView` - required for torch controller setup
    Returns:
      torch controller

  - ### setScanRecognitionModeOverlay

    void setScanRecognitionModeOverlay(ScanRecognitionMode scanRecognitionMode)
    Sets recognition mode used for onboarding overlay resources selection.
    Parameters:
      `scanRecognitionMode` - required for onboarding overlay resources selection

  - ### onFirstSideScanStarted

    void onFirstSideScanStarted()
    Called when scanning of the first side starts.

  - ### onFirstSideScanSuccess

    void onFirstSideScanSuccess(boolean isPassportScan, CardRotation cardRotation)
    Called when scanning of the first side finishes successfully.

  - ### onSecondSideScanStarted

    void onSecondSideScanStarted()
    Called when scanning of the second side starts.

  - ### onMovingCloserToBarcodeRequired

    void onMovingCloserToBarcodeRequired()
    Called when user should be instructed to move closer to barcode.

  - ### setRecognizerSupportsClassification

    void setRecognizerSupportsClassification(boolean isClassificationSupported)
    If true, this means that recognizer supports classification and `onDocumentClassified()` will be called when the document is classified.
    Parameters:
      `isClassificationSupported` - true if classification is supported

  - ### onDocumentClassified

    void onDocumentClassified()
    Called when document is successfully classified and recognition starts.

  - ### onCardDetectionUpdate

    void onCardDetectionUpdate(@NonNull DetectionStatus detectionStatus)
    Called on any update to card detection process.

  - ### onProcessingError

    void onProcessingError(@NonNull BlinkIdOverlayView.ProcessingError processingError)
    Called when processing error, which should be displayed to the user, occurs.
    Parameters:
      `processingError` - processing error type.

  - ### onScanSuccess

    long onScanSuccess()
    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.
    Returns:
      delay in milliseconds

  - ### onErrorDialogShown

    void onErrorDialogShown()
    Called when error dialog is shown. Make sure to stop animations here.

  - ### onGlare

    void onGlare(boolean hasGlare)
    Called on glare detection update.
    Parameters:
      `hasGlare` - true if glare detected

  - ### onTorchStateChanged

    void onTorchStateChanged(boolean torchOn)
    Called when torch (flashlight) state is updated.
    Parameters:
      `torchOn` - `true` if torch is turned on, `false` otherwise.

  - ### getDocumentNotSupportedDialogStrings

    @NonNull RetryDialogStrings getDocumentNotSupportedDialogStrings()
    Returns:
      strings to be used for error dialog shown when document is not supported

  - ### getRecognitionTimeoutDialogStrings

    @NonNull RetryDialogStrings getRecognitionTimeoutDialogStrings()
    Returns:
      strings to be used for error dialog shown when second document side can't be recognized

  - ### getSidesNotMatchingDialogStrings

    @NonNull RetryDialogStrings getSidesNotMatchingDialogStrings()
    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 RetryDialogStrings getDataMismatchStrings()
    Returns:
      strings to be used for error dialog shown when scanned document has data mismatch

  - ### setShowBackSideBarcodeInstructions

    void setShowBackSideBarcodeInstructions(boolean shouldShow)
    Set whether to show additional instructions when scanning back side of the document instructing user to scan the barcode.
    Parameters:
      `shouldShow` - true if barcode instructions should be shown

  - ### cleanup

    void cleanup()
    Clean up your resources here.

  - ### setMandatoryFieldsMissingTooltipText

    void setMandatoryFieldsMissingTooltipText(int[] stringRes, android.app.Activity activity)

  - ### getOnboardingView

    @Nullable OnboardingView getOnboardingView()