Class DocumentScannerView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,io.scanbot.sdk.docdetection.ui.IDocumentScannerView
public class DocumentScannerView extends FrameLayout implements IDocumentScannerView
A component which allows to quickly integrate a Document scanning feature into your application. It wraps ContourDetectorFrameHandler, io.scanbot.sdk.ui.camera.IScanbotCameraView, io.scanbot.sdk.camera.IFinderView and DocumentAutoSnappingController providing an interface allowing to contol appearance and behavior of the component.
To start using it you need to add DocumentScannerView into your layout and the call two methods initCamera and initDetectionBehavior (see corresponding docs).
If you use a legacy camera (non CameraX - see CameraUiSettings) it is also required to call IDocumentScannerViewController.onResume on the viewController in Activity onResume and IDocumentScannerViewController.onPause on the viewController in Activity onPause
-
-
Field Summary
Fields Modifier and Type Field Description private final IDocumentScannerViewController
viewController
private final IDocumentScannerViewCameraConfiguration
cameraConfiguration
private final IDocumentScannerPolygonViewController
polygonConfiguration
private final IDocumentFinderViewController
finderViewController
-
Constructor Summary
Constructors Constructor Description DocumentScannerView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description IDocumentScannerViewController
getViewController()
Use this object to control the state or the behavior of the IDocumentScannerView IDocumentScannerViewCameraConfiguration
getCameraConfiguration()
Use this object to control configuration parameters of the Camera inside IDocumentScannerPolygonViewController
getPolygonConfiguration()
Use this object to control configuration parameters of the Polygon view inside IDocumentFinderViewController
getFinderViewController()
Use this object to control configuration parameters of the Finder view inside Unit
initCamera(CameraUiSettings cameraUiSettings)
This must be called in the onCreate of the Activity Unit
initDetectionBehavior(ContourDetector contourDetector, ContourDetectorFrameHandler.ResultHandler contourDetectorResultHandler, IDocumentScannerViewCallback callback)
This should be called as soon as you have an instance of the Contour detector. -
-
Constructor Detail
-
DocumentScannerView
DocumentScannerView(Context context, AttributeSet attrs)
-
-
Method Detail
-
getViewController
IDocumentScannerViewController getViewController()
Use this object to control the state or the behavior of the IDocumentScannerView
-
getCameraConfiguration
IDocumentScannerViewCameraConfiguration getCameraConfiguration()
Use this object to control configuration parameters of the Camera inside
-
getPolygonConfiguration
IDocumentScannerPolygonViewController getPolygonConfiguration()
Use this object to control configuration parameters of the Polygon view inside
-
getFinderViewController
IDocumentFinderViewController getFinderViewController()
Use this object to control configuration parameters of the Finder view inside
-
initCamera
Unit initCamera(CameraUiSettings cameraUiSettings)
This must be called in the onCreate of the Activity
-
initDetectionBehavior
Unit initDetectionBehavior(ContourDetector contourDetector, ContourDetectorFrameHandler.ResultHandler contourDetectorResultHandler, IDocumentScannerViewCallback callback)
This should be called as soon as you have an instance of the Contour detector. It is recommended to call it in onCreate of the Activity
-
-
-
-