public final class FieldByFieldOverlayController extends BaseOverlayController implements OnActivityFlipListener
errorDialog, handler, overlayState, recognizerRunnerFragment, recognizerRunnerView, scanResultListener, scanSoundPlayer, torchController| Constructor and Description |
|---|
FieldByFieldOverlayController(FieldByFieldOverlaySettings settings,
ScanResultListener scanResultListener) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getBeepSoundResourceId() |
protected int |
getSplashScreenLayoutId() |
void |
onActivityFlip()
Called when activity is flipped.
|
protected void |
onFragmentConfigurationChanged(android.content.res.Configuration newConfig) |
protected void |
onFragmentCreated(android.os.Bundle savedInstanceState) |
protected void |
onFragmentResumed() |
protected void |
onFragmentSaveInstanceState(android.os.Bundle outState) |
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 |
onScanningDone(RecognitionSuccessType recognitionSuccessType)
This method is called when recognition is done.
|
protected void |
setMeteringAreas() |
protected boolean |
shouldResetStateOnRecognizerResume() |
getContext, onCameraAutofocusFailed, onFragmentDestroyed, onFragmentPaused, onFragmentStarted, onFragmentStopped, onFrameRecognitionDone, onUnrecoverableError, pauseScanning, resumeScanningpublic FieldByFieldOverlayController(@NonNull
FieldByFieldOverlaySettings settings,
@NonNull
ScanResultListener scanResultListener)
public void onRecognizerRunnerFragmentAttached(@NonNull
RecognizerRunnerFragment recognizerRunnerFragment,
@NonNull
android.app.Activity activity)
ScanningOverlayRecognizerRunnerFragment gets attached to its host activity. This happens before
RecognizerRunnerFragment.onCreateView(LayoutInflater, ViewGroup, Bundle) which internally invokes
ScanningOverlay.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.onRecognizerRunnerFragmentAttached in interface ScanningOverlayonRecognizerRunnerFragmentAttached in class BaseOverlayControllerrecognizerRunnerFragment - RecognizerRunnerFragment that has been attached to host activity.activity - Activity to which RecognizerRunnerFragment has been attached.protected int getSplashScreenLayoutId()
getSplashScreenLayoutId in class BaseOverlayControllerpublic void onRecognizerRunnerViewCreated(@NonNull
RecognizerRunnerFragment recognizerRunnerFragment)
ScanningOverlayRecognizerRunnerView 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.onRecognizerRunnerViewCreated in interface ScanningOverlayonRecognizerRunnerViewCreated in class BaseOverlayControllerrecognizerRunnerFragment - RecognizerRunnerFragment within which RecognizerRunnerView has been created.protected boolean shouldResetStateOnRecognizerResume()
shouldResetStateOnRecognizerResume in class BaseOverlayControllerprotected int getBeepSoundResourceId()
getBeepSoundResourceId in class BaseOverlayControllerpublic void onScanningDone(@NonNull
RecognitionSuccessType recognitionSuccessType)
ScanResultListeneronScanningDone in interface ScanResultListenerrecognitionSuccessType - indicates the success type of recognitionprotected void onFragmentCreated(@Nullable
android.os.Bundle savedInstanceState)
onFragmentCreated in class BaseOverlayControllerprotected void onFragmentResumed()
onFragmentResumed in class BaseOverlayControllerprotected void onFragmentConfigurationChanged(@NonNull
android.content.res.Configuration newConfig)
onFragmentConfigurationChanged in class BaseOverlayControllerprotected void onFragmentSaveInstanceState(@Nullable
android.os.Bundle outState)
onFragmentSaveInstanceState in class BaseOverlayControllerpublic void onActivityFlip()
OnActivityFlipListeneronActivityFlip in interface OnActivityFlipListenerprotected void setMeteringAreas()
setMeteringAreas in class BaseOverlayController