Package com.microblink.blinkid.fragment.overlay

# Interface ScanningOverlay

All Superinterfaces:
  `ScanResultListener`

All Known Implementing Classes:
  `BaseOverlayController`, `BlinkIdOverlayController`

@MainThread public interface ScanningOverlay extends ScanResultListener
Interface which every overlay set on `RecognizerRunnerFragment` must implement.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onFrameRecognitionDone(RecognitionSuccessType recognitionSuccessType)`
  Called for each camera frame, after the recognition has been completed.
  `void`
  `onRecognizerRunnerFragmentAttached(RecognizerRunnerFragment recognizerRunnerFragment, android.app.Activity activity)`
  Called after `RecognizerRunnerFragment` gets attached to its host activity.
  `void`
  `onRecognizerRunnerViewCreated(RecognizerRunnerFragment recognizerRunnerFragment)`
  Called when `RecognizerRunnerView` has been created within given `RecognizerRunnerFragment`.
  `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)` }.

  ### Methods inherited from interface com.microblink.blinkid.view.recognition.ScanResultListener

  `onScanningDone, onUnrecoverableError`

- ## Method Details

  - ### resumeScanning

    @AnyThread void resumeScanning()
    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.

    See Also:
      - `RecognizerRunnerView.resumeScanning(boolean)`

  - ### pauseScanning

    @AnyThread void pauseScanning()
    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 `resumeScanning()`.

    See Also:
      - `RecognizerRunnerView.pauseScanning()`

  - ### onRecognizerRunnerViewCreated

    void onRecognizerRunnerViewCreated(@NonNull RecognizerRunnerFragment recognizerRunnerFragment)
    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.
    Parameters:
      `recognizerRunnerFragment` - `RecognizerRunnerFragment` within which `RecognizerRunnerView` has been created.

  - ### onRecognizerRunnerFragmentAttached

    void onRecognizerRunnerFragmentAttached(@NonNull RecognizerRunnerFragment recognizerRunnerFragment, @NonNull android.app.Activity activity)
    Called after `RecognizerRunnerFragment` gets attached to its host activity. This happens before `RecognizerRunnerFragment.onCreateView(LayoutInflater, ViewGroup, Bundle)` which internally invokes `onRecognizerRunnerViewCreated(RecognizerRunnerFragment)`. This means that at the time this method is invoked, methods like `RecognizerRunnerFragment.getRecognizerRunnerView()` or `RecognizerRunnerFragment.getContentLayout()` will return null. However, this is a good place to register your `LifecycleObserver` with `RecognizerRunnerFragment.registerLifecycleObserver(LifecycleObserver)` if your overlay needs to be notified about lifecycle events of `RecognizerRunnerFragment`.
    Parameters:
      `recognizerRunnerFragment` - `RecognizerRunnerFragment` that has been attached to host activity.
      `activity` - `Activity` to which `RecognizerRunnerFragment` has been attached.

  - ### onFrameRecognitionDone

    @WorkerThread void onFrameRecognitionDone(RecognitionSuccessType recognitionSuccessType)
    Called for each camera frame, after the recognition has been completed.
    Parameters:
      `recognitionSuccessType` - frame recognition status.