Class FieldByFieldOverlayController
java.lang.Object
com.microblink.photopay.fragment.overlay.BaseOverlayController
com.microblink.photopay.fragment.overlay.fieldbyfield.FieldByFieldOverlayController
- All Implemented Interfaces:
ScanningOverlay,OnActivityFlipListener,ScanResultListener
public final class FieldByFieldOverlayController
extends BaseOverlayController
implements OnActivityFlipListener
-
Field Summary
Fields inherited from class com.microblink.photopay.fragment.overlay.BaseOverlayController
errorDialog, handler, overlayState, recognizerRunnerFragment, recognizerRunnerView, scanResultListener, scanSoundPlayer, torchController -
Constructor Summary
ConstructorsConstructorDescriptionFieldByFieldOverlayController(FieldByFieldOverlaySettings settings, ScanResultListener scanResultListener) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intvoidCalled when activity is flipped.protected voidonFragmentConfigurationChanged(android.content.res.Configuration newConfig) protected voidonFragmentCreated(android.os.Bundle savedInstanceState) protected voidprotected voidonFragmentSaveInstanceState(android.os.Bundle outState) voidonRecognizerRunnerFragmentAttached(RecognizerRunnerFragment recognizerRunnerFragment, android.app.Activity activity) Called afterRecognizerRunnerFragmentgets attached to its host activity.voidonRecognizerRunnerViewCreated(RecognizerRunnerFragment recognizerRunnerFragment) Called whenRecognizerRunnerViewhas been created within givenRecognizerRunnerFragment.voidonScanningDone(RecognitionSuccessType recognitionSuccessType) This method is called when recognition is done.protected voidprotected booleanMethods inherited from class com.microblink.photopay.fragment.overlay.BaseOverlayController
getContext, onCameraAutofocusFailed, onFragmentDestroyed, onFragmentPaused, onFragmentStarted, onFragmentStopped, onFrameRecognitionDone, onUnrecoverableError, pauseScanning, resumeScanning
-
Constructor Details
-
FieldByFieldOverlayController
public FieldByFieldOverlayController(@NonNull FieldByFieldOverlaySettings settings, @NonNull ScanResultListener scanResultListener)
-
-
Method Details
-
onRecognizerRunnerFragmentAttached
public void onRecognizerRunnerFragmentAttached(@NonNull RecognizerRunnerFragment recognizerRunnerFragment, @NonNull android.app.Activity activity) Description copied from interface:ScanningOverlayCalled afterRecognizerRunnerFragmentgets attached to its host activity. This happens beforeRecognizerRunnerFragment.onCreateView(LayoutInflater, ViewGroup, Bundle)which internally invokesScanningOverlay.onRecognizerRunnerViewCreated(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 yourLifecycleObserverwithRecognizerRunnerFragment.registerLifecycleObserver(LifecycleObserver)if your overlay needs to be notified about lifecycle events ofRecognizerRunnerFragment.- Specified by:
onRecognizerRunnerFragmentAttachedin interfaceScanningOverlay- Overrides:
onRecognizerRunnerFragmentAttachedin classBaseOverlayController- Parameters:
recognizerRunnerFragment-RecognizerRunnerFragmentthat has been attached to host activity.activity-Activityto whichRecognizerRunnerFragmenthas been attached.
-
getSplashScreenLayoutId
protected int getSplashScreenLayoutId()- Specified by:
getSplashScreenLayoutIdin classBaseOverlayController
-
onRecognizerRunnerViewCreated
public void onRecognizerRunnerViewCreated(@NonNull RecognizerRunnerFragment recognizerRunnerFragment) Description copied from interface:ScanningOverlayCalled whenRecognizerRunnerViewhas been created within givenRecognizerRunnerFragment. You can useRecognizerRunnerFragment.getRecognizerRunnerView()to get the createdRecognizerRunnerViewand configure it. The most important thing you should do in this method is to setRecognizerBundleto createdRecognizerRunnerViewusingRecognizerRunnerView.setRecognizerBundle(RecognizerBundle). You can also register various callbacks toRecognizerRunnerView, exceptCameraEventsListener(usingBaseCameraView.setCameraEventsListener(CameraEventsListener)) andScanResultListener(usingRecognizerRunnerView.setScanResultListener(ScanResultListener)- those two listeners will be set toRecognizerRunnerViewwithinRecognizerRunnerFragmentafter calling this method - if you need to observe camera events withinRecognizerRunnerFragment, you can set your ownBaseCameraEventsListenerto it withRecognizerRunnerFragment.setCameraEventsListener(BaseCameraEventsListener). In this method, you can also accessRecognizerRunnerFragment's content layout with methodRecognizerRunnerFragment.getContentLayout()and add your views to it.- Specified by:
onRecognizerRunnerViewCreatedin interfaceScanningOverlay- Overrides:
onRecognizerRunnerViewCreatedin classBaseOverlayController- Parameters:
recognizerRunnerFragment-RecognizerRunnerFragmentwithin whichRecognizerRunnerViewhas been created.
-
shouldResetStateOnRecognizerResume
protected boolean shouldResetStateOnRecognizerResume()- Specified by:
shouldResetStateOnRecognizerResumein classBaseOverlayController
-
getBeepSoundResourceId
protected int getBeepSoundResourceId()- Specified by:
getBeepSoundResourceIdin classBaseOverlayController
-
onScanningDone
Description copied from interface:ScanResultListenerThis method is called when recognition is done. This method might be called on background thread or main thread, depending on the type of scan.- Specified by:
onScanningDonein interfaceScanResultListener- Parameters:
recognitionSuccessType- indicates the success type of recognition
-
onFragmentCreated
protected void onFragmentCreated(@Nullable android.os.Bundle savedInstanceState) - Overrides:
onFragmentCreatedin classBaseOverlayController
-
onFragmentResumed
protected void onFragmentResumed()- Overrides:
onFragmentResumedin classBaseOverlayController
-
onFragmentConfigurationChanged
protected void onFragmentConfigurationChanged(@NonNull android.content.res.Configuration newConfig) - Overrides:
onFragmentConfigurationChangedin classBaseOverlayController
-
onFragmentSaveInstanceState
protected void onFragmentSaveInstanceState(@Nullable android.os.Bundle outState) - Overrides:
onFragmentSaveInstanceStatein classBaseOverlayController
-
onActivityFlip
public void onActivityFlip()Description copied from interface:OnActivityFlipListenerCalled when activity is flipped. This can happen if your activity is in sensor or user orientation mode and landscape to reverse landscape or portrait to reverse portrait or vice versa orientation change has occurred. Normally, Android will not give you any notification when this orientation change occurs, so SDK automatically detects that and with this listener informs you of such event.- Specified by:
onActivityFlipin interfaceOnActivityFlipListener
-
setMeteringAreas
protected void setMeteringAreas()- Overrides:
setMeteringAreasin classBaseOverlayController
-