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

# Class BlinkIdOverlayController

java.lang.Object
com.microblink.blinkid.fragment.overlay.BaseOverlayController
com.microblink.blinkid.fragment.overlay.blinkid.BlinkIdOverlayController

All Implemented Interfaces:
  `ScanningOverlay`, `ScanResultListener`

public class BlinkIdOverlayController extends BaseOverlayController

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final DocumentRecognizerManager`
  `documentRecognizerManager`
  `protected ImageUploadManager`
  `imageUploadManager`
  `protected com.microblink.blinkid.fragment.overlay.PingSessionFlowManager`
  `pingSessionFlowManager`

  ### Fields inherited from class com.microblink.blinkid.fragment.overlay.BaseOverlayController

  `errorDialog, handler, overlayState, recognizerRunnerFragment, recognizerRunnerView, scanResultListener, scanSoundPlayer, torchController`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlinkIdOverlayController(BlinkIdOverlaySettings overlaySettings, ScanResultListener scanResultListener, BlinkIdOverlayView overlayView)`
  Pass in your own implementation of `BlinkIdOverlayView` to customise the UI, or use one of our overlay views, `ReticleOverlayView`, `DocumentOverlayView`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected ImageUploadManager`
  `createImageUploadManager()`
  `protected int`
  `getBeepSoundResourceId()`
  `HighResImagesBundle`
  `getHighResImagesBundle()`
  `RecognizerBundle`
  `getRecognizerBundle()`
  `ScanRecognitionMode`
  `getScanRecognitionMode(DocumentRecognizerManager documentRecognizerManager)`
  `protected int`
  `getSplashScreenLayoutId()`
  `protected void`
  `onCameraAutofocusFailed()`
  `protected void`
  `onDocumentSideChanged(long firstSideDelay)`
  `protected void`
  `onFirstSideScanStarted()`
  `protected void`
  `onFragmentConfigurationChanged(android.content.res.Configuration newConfig)`
  `protected void`
  `onFragmentDestroyed()`
  `protected void`
  `onFragmentPaused()`
  `protected void`
  `onFragmentResumed()`
  `protected void`
  `onFragmentSaveInstanceState(android.os.Bundle outState)`
  `void`
  `onFrameRecognitionDone(RecognitionSuccessType recognitionSuccessType)`
  Called for each camera frame, after the recognition has been completed.
  `void`
  `onRecognizerRunnerViewCreated(RecognizerRunnerFragment recognizerRunnerFragment)`
  Called when `RecognizerRunnerView` has been created within given `RecognizerRunnerFragment`.
  `void`
  `onScanningDone(RecognitionSuccessType successType)`
  This method is called when recognition is done.
  `void`
  `pauseScanning()`
  If the `RecognizerRunnerView` has been created, pauses the scanning loop by calling `RecognizerRunnerView.pauseScanning()`.
  `void`
  `resumeScanning()`
  If the `RecognizerRunnerView` has been created, resumes the scanning loop (that has been paused) by calling `RecognizerRunnerView.resumeScanning(boolean)` }.
  `protected boolean`
  `shouldResetStateOnRecognizerResume()`

  ### Methods inherited from class com.microblink.blinkid.fragment.overlay.BaseOverlayController

  `getContext, onFragmentCreated, onFragmentStarted, onFragmentStopped, onRecognizerRunnerFragmentAttached, onUnrecoverableError, setMeteringAreas`

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

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

- ## Field Details

  - ### documentRecognizerManager

    @NonNull protected final DocumentRecognizerManager documentRecognizerManager

  - ### imageUploadManager

    @NonNull protected ImageUploadManager imageUploadManager

  - ### pingSessionFlowManager

    @NonNull protected com.microblink.blinkid.fragment.overlay.PingSessionFlowManager pingSessionFlowManager

- ## Constructor Details

  - ### BlinkIdOverlayController

    public BlinkIdOverlayController(@NonNull BlinkIdOverlaySettings overlaySettings, @NonNull ScanResultListener scanResultListener, @NonNull BlinkIdOverlayView overlayView)
    Pass in your own implementation of `BlinkIdOverlayView` to customise the UI, or use one of our overlay views, `ReticleOverlayView`, `DocumentOverlayView`
    Parameters:
      `overlaySettings` - configuration settings
      `scanResultListener` - listener to be notified when scanning is done
      `overlayView` - custom UI implementation

- ## Method Details

  - ### getHighResImagesBundle

    @AnyThread @NonNull public HighResImagesBundle getHighResImagesBundle()

  - ### getRecognizerBundle

    @AnyThread @NonNull public RecognizerBundle getRecognizerBundle()

  - ### onScanningDone

    public void onScanningDone(@NonNull RecognitionSuccessType successType)
    Description copied from interface: `ScanResultListener`
    This method is called when recognition is done. This method might be called on background thread or main thread, depending on the type of scan.
    Parameters:
      `successType` - indicates the success type of recognition

  - ### onFrameRecognitionDone

    public void onFrameRecognitionDone(RecognitionSuccessType recognitionSuccessType)
    Description copied from interface: `ScanningOverlay`
    Called for each camera frame, after the recognition has been completed.
    Specified by:
      `onFrameRecognitionDone` in interface `ScanningOverlay`
    Overrides:
      `onFrameRecognitionDone` in class `BaseOverlayController`
    Parameters:
      `recognitionSuccessType` - frame recognition status.

  - ### onRecognizerRunnerViewCreated

    public void onRecognizerRunnerViewCreated(@NonNull RecognizerRunnerFragment recognizerRunnerFragment)
    Description copied from interface: `ScanningOverlay`
    Called when `RecognizerRunnerView` has been created within given `RecognizerRunnerFragment`. You can use `RecognizerRunnerFragment.getRecognizerRunnerView()` to get the created `RecognizerRunnerView` and configure it. The most important thing you should do in this method is to set `RecognizerBundle` to created `RecognizerRunnerView` using `RecognizerRunnerView.setRecognizerBundle(RecognizerBundle)`. You can also register various callbacks to `RecognizerRunnerView`, except `CameraEventsListener` (using `BaseCameraView.setCameraEventsListener(CameraEventsListener)`) and `ScanResultListener` (using `RecognizerRunnerView.setScanResultListener(ScanResultListener)` - those two listeners will be set to `RecognizerRunnerView` within `RecognizerRunnerFragment` after calling this method - if you need to observe camera events within `RecognizerRunnerFragment`, you can set your own `BaseCameraEventsListener` to it with `RecognizerRunnerFragment.setCameraEventsListener(BaseCameraEventsListener)`. In this method, you can also access `RecognizerRunnerFragment`'s content layout with method `RecognizerRunnerFragment.getContentLayout()` and add your views to it.
    Specified by:
      `onRecognizerRunnerViewCreated` in interface `ScanningOverlay`
    Overrides:
      `onRecognizerRunnerViewCreated` in class `BaseOverlayController`
    Parameters:
      `recognizerRunnerFragment` - `RecognizerRunnerFragment` within which `RecognizerRunnerView` has been created.

  - ### pauseScanning

    public void pauseScanning()
    Description copied from interface: `ScanningOverlay`
    If the `RecognizerRunnerView` has been created, pauses the scanning loop by calling `RecognizerRunnerView.pauseScanning()`. But keeps camera active. If the `RecognizerRunnerView` has not been created yet, does nothing.

    You can resume scanning by calling `ScanningOverlay.resumeScanning()`.

    Specified by:
      `pauseScanning` in interface `ScanningOverlay`
    Overrides:
      `pauseScanning` in class `BaseOverlayController`
    See Also:
      - `RecognizerRunnerView.pauseScanning()`

  - ### resumeScanning

    public void resumeScanning()
    Description copied from interface: `ScanningOverlay`
    If the `RecognizerRunnerView` has been created, resumes the scanning loop (that has been paused) by calling `RecognizerRunnerView.resumeScanning(boolean)` }.

    If the `RecognizerRunnerView` has not been created yet, does nothing.

    Specified by:
      `resumeScanning` in interface `ScanningOverlay`
    Overrides:
      `resumeScanning` in class `BaseOverlayController`
    See Also:
      - `RecognizerRunnerView.resumeScanning(boolean)`

  - ### shouldResetStateOnRecognizerResume

    protected boolean shouldResetStateOnRecognizerResume()
    Specified by:
      `shouldResetStateOnRecognizerResume` in class `BaseOverlayController`

  - ### getBeepSoundResourceId

    protected int getBeepSoundResourceId()
    Specified by:
      `getBeepSoundResourceId` in class `BaseOverlayController`

  - ### getSplashScreenLayoutId

    protected int getSplashScreenLayoutId()
    Specified by:
      `getSplashScreenLayoutId` in class `BaseOverlayController`

  - ### createImageUploadManager

    protected ImageUploadManager createImageUploadManager()

  - ### onCameraAutofocusFailed

    protected void onCameraAutofocusFailed()
    Overrides:
      `onCameraAutofocusFailed` in class `BaseOverlayController`

  - ### onDocumentSideChanged

    @CallSuper protected void onDocumentSideChanged(long firstSideDelay)

  - ### onFirstSideScanStarted

    @CallSuper protected void onFirstSideScanStarted()

  - ### onFragmentResumed

    protected void onFragmentResumed()
    Overrides:
      `onFragmentResumed` in class `BaseOverlayController`

  - ### onFragmentPaused

    protected void onFragmentPaused()
    Overrides:
      `onFragmentPaused` in class `BaseOverlayController`

  - ### onFragmentDestroyed

    protected void onFragmentDestroyed()
    Overrides:
      `onFragmentDestroyed` in class `BaseOverlayController`

  - ### onFragmentConfigurationChanged

    protected void onFragmentConfigurationChanged(@NonNull android.content.res.Configuration newConfig)
    Overrides:
      `onFragmentConfigurationChanged` in class `BaseOverlayController`

  - ### onFragmentSaveInstanceState

    protected void onFragmentSaveInstanceState(@Nullable android.os.Bundle outState)
    Overrides:
      `onFragmentSaveInstanceState` in class `BaseOverlayController`

  - ### getScanRecognitionMode

    @Nullable public ScanRecognitionMode getScanRecognitionMode(DocumentRecognizerManager documentRecognizerManager)