Class DocumentCaptureOverlayController
java.lang.Object
com.microblink.blinkinput.fragment.overlay.BaseOverlayController
com.microblink.blinkinput.fragment.overlay.documentcapture.DocumentCaptureOverlayController
- All Implemented Interfaces:
DocumentCaptureContract.OverlayController,ScanningOverlay,ScanResultListener
public class DocumentCaptureOverlayController
extends BaseOverlayController
implements DocumentCaptureContract.OverlayController
-
Field Summary
Fields inherited from class com.microblink.blinkinput.fragment.overlay.BaseOverlayController
errorDialog, handler, overlayState, recognizerRunnerFragment, recognizerRunnerView, scanResultListener, scanSoundPlayer, torchController -
Constructor Summary
ConstructorsConstructorDescriptionDocumentCaptureOverlayController(DocumentCaptureOverlaySettings overlaySettings, ScanResultListener scanResultListener, DocumentCaptureContract.OverlayView overlayView) Pass in your own implementation ofDocumentCaptureContract.OverlayViewto customise UI, or use our overlay viewDetectionOverlayView. -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intvoidCalled when back button is clicked in the view.protected voidvoidCalled when image capture button is clicked in the view.protected voidonFragmentConfigurationChanged(android.content.res.Configuration newConfig) protected voidprotected voidprotected voidonFragmentSaveInstanceState(android.os.Bundle outState) voidonRecognizerRunnerViewCreated(RecognizerRunnerFragment recognizerRunnerFragment) Called whenRecognizerRunnerViewhas been created within givenRecognizerRunnerFragment.voidonScanningDone(RecognitionSuccessType recognitionSuccessType) This method is called when recognition is done.voidCalled when torch button is clicked in the view.voidvoidsetTorchStateListener(OverlayTorchStateListener torchStateListener) Sets the torch state listener that will be notified when torch state is changed.protected booleanMethods inherited from class com.microblink.blinkinput.fragment.overlay.BaseOverlayController
getContext, onFragmentCreated, onFragmentPaused, onFragmentStarted, onFragmentStopped, onFrameRecognitionDone, onRecognizerRunnerFragmentAttached, onUnrecoverableError, pauseScanning, resumeScanning, setMeteringAreas
-
Constructor Details
-
DocumentCaptureOverlayController
public DocumentCaptureOverlayController(@NonNull DocumentCaptureOverlaySettings overlaySettings, @NonNull ScanResultListener scanResultListener, @NonNull DocumentCaptureContract.OverlayView overlayView) Pass in your own implementation ofDocumentCaptureContract.OverlayViewto customise UI, or use our overlay viewDetectionOverlayView.- Parameters:
overlaySettings- overlay settingsscanResultListener- listener to be notified when scanning is doneoverlayView- custom UI implementation
-
-
Method Details
-
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
-
getSplashScreenLayoutId
protected int getSplashScreenLayoutId()- Specified by:
getSplashScreenLayoutIdin 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
-
onFragmentResumed
protected void onFragmentResumed()- Overrides:
onFragmentResumedin classBaseOverlayController
-
onFragmentDestroyed
protected void onFragmentDestroyed()- Overrides:
onFragmentDestroyedin 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
-
onCameraAutofocusFailed
protected void onCameraAutofocusFailed()- Overrides:
onCameraAutofocusFailedin classBaseOverlayController
-
setTorchStateListener
Sets the torch state listener that will be notified when torch state is changed.- Parameters:
torchStateListener- torch state listener that will be notified when torch state is changed.
-
onCaptureButtonClicked
public void onCaptureButtonClicked()Description copied from interface:DocumentCaptureContract.OverlayControllerCalled when image capture button is clicked in the view.- Specified by:
onCaptureButtonClickedin interfaceDocumentCaptureContract.OverlayController
-
resumeScanningAfterScanningDone
public void resumeScanningAfterScanningDone() -
onBackButtonClicked
public void onBackButtonClicked()Description copied from interface:DocumentCaptureContract.OverlayControllerCalled when back button is clicked in the view.- Specified by:
onBackButtonClickedin interfaceDocumentCaptureContract.OverlayController
-
onTorchButtonClicked
public void onTorchButtonClicked()Description copied from interface:DocumentCaptureContract.OverlayControllerCalled when torch button is clicked in the view.- Specified by:
onTorchButtonClickedin interfaceDocumentCaptureContract.OverlayController
-