Interface ScanningOverlay
- All Superinterfaces:
ScanResultListener
- All Known Implementing Classes:
BaseOverlayController
,BlinkIdOverlayController
Interface which every overlay set on
RecognizerRunnerFragment
must implement.-
Method Summary
Modifier and TypeMethodDescriptionvoid
onFrameRecognitionDone
(RecognitionSuccessType recognitionSuccessType) Called for each camera frame, after the recognition has been completed.void
onRecognizerRunnerFragmentAttached
(RecognizerRunnerFragment recognizerRunnerFragment, android.app.Activity activity) Called afterRecognizerRunnerFragment
gets attached to its host activity.void
onRecognizerRunnerViewCreated
(RecognizerRunnerFragment recognizerRunnerFragment) Called whenRecognizerRunnerView
has been created within givenRecognizerRunnerFragment
.void
If theRecognizerRunnerView
has been created, pauses the scanning loop by callingRecognizerRunnerView.pauseScanning()
.void
If theRecognizerRunnerView
has been created, resumes the scanning loop (that has been paused) by callingRecognizerRunnerView.resumeScanning(boolean)
}.Methods inherited from interface com.microblink.blinkid.view.recognition.ScanResultListener
onScanningDone, onUnrecoverableError
-
Method Details
-
resumeScanning
@AnyThread void resumeScanning()If theRecognizerRunnerView
has been created, resumes the scanning loop (that has been paused) by callingRecognizerRunnerView.resumeScanning(boolean)
}.If the
RecognizerRunnerView
has not been created yet, does nothing. -
pauseScanning
@AnyThread void pauseScanning()If theRecognizerRunnerView
has been created, pauses the scanning loop by callingRecognizerRunnerView.pauseScanning()
. But keeps camera active. If theRecognizerRunnerView
has not been created yet, does nothing.You can resume scanning by calling
resumeScanning()
.- See Also:
-
onRecognizerRunnerViewCreated
Called whenRecognizerRunnerView
has been created within givenRecognizerRunnerFragment
. You can useRecognizerRunnerFragment.getRecognizerRunnerView()
to get the createdRecognizerRunnerView
and configure it. The most important thing you should do in this method is to setRecognizerBundle
to createdRecognizerRunnerView
usingRecognizerRunnerView.setRecognizerBundle(RecognizerBundle)
. You can also register various callbacks toRecognizerRunnerView
, exceptCameraEventsListener
(usingBaseCameraView.setCameraEventsListener(CameraEventsListener)
) andScanResultListener
(usingRecognizerRunnerView.setScanResultListener(ScanResultListener)
- those two listeners will be set toRecognizerRunnerView
withinRecognizerRunnerFragment
after calling this method - if you need to observe camera events withinRecognizerRunnerFragment
, you can set your ownBaseCameraEventsListener
to it withRecognizerRunnerFragment.setCameraEventsListener(BaseCameraEventsListener)
. In this method, you can also accessRecognizerRunnerFragment
's content layout with methodRecognizerRunnerFragment.getContentLayout()
and add your views to it.- Parameters:
recognizerRunnerFragment
-RecognizerRunnerFragment
within whichRecognizerRunnerView
has been created.
-
onRecognizerRunnerFragmentAttached
void onRecognizerRunnerFragmentAttached(@NonNull RecognizerRunnerFragment recognizerRunnerFragment, @NonNull android.app.Activity activity) Called afterRecognizerRunnerFragment
gets attached to its host activity. This happens beforeRecognizerRunnerFragment.onCreateView(LayoutInflater, ViewGroup, Bundle)
which internally invokesonRecognizerRunnerViewCreated(RecognizerRunnerFragment)
. This means that at the time this method is invoked, methods likeRecognizerRunnerFragment.getRecognizerRunnerView()
orRecognizerRunnerFragment.getContentLayout()
will return null. However, this is a good place to register yourLifecycleObserver
withRecognizerRunnerFragment.registerLifecycleObserver(LifecycleObserver)
if your overlay needs to be notified about lifecycle events ofRecognizerRunnerFragment
.- Parameters:
recognizerRunnerFragment
-RecognizerRunnerFragment
that has been attached to host activity.activity
-Activity
to whichRecognizerRunnerFragment
has been attached.
-
onFrameRecognitionDone
Called for each camera frame, after the recognition has been completed.- Parameters:
recognitionSuccessType
- frame recognition status.
-