FinderDocumentScannerConfiguration

Class which is used to configure io.scanbot.sdk.ui.view.camera.DocumentScannerActivity Contains settings indicating views Behaviour, Texts and Appearance.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Functions

Link copied to clipboard
fun enableHardwareSnapButton(key: Int = KeyEvent.KEYCODE_VOLUME_DOWN)

Enable pressing hardware button to make snap on this screen. Pass KeyEvent.KEYCODE_VOLUME_DOWN or any other KeyEvent.KEYCODE that is supported by the device. By default for kotlin KeyEvent.KEYCODE_VOLUME_DOWN code being used.

Link copied to clipboard
fun setAcceptedAngleScore(acceptedAngleScore: Double)

The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Default is 75.0.

Link copied to clipboard
fun setAcceptedBrightnessThreshold(acceptedBrightnessThreshold: Double)

The brightness threshold to accept a detected document in the range of 0 (very dark) to 255 (very bright). If the average brightness value of the detectors input image is below this value, the status of the detection will be set to ERROR_TOO_DARK. Default is 50.0.

Link copied to clipboard
fun setAcceptedSizeScore(acceptedSizeScore: Double)

The minimum document width or height in percent (0 - 100) of the screen size to accept a detected document. Default is 80.0.

Link copied to clipboard

A configuration with accessibility texts settings.

Link copied to clipboard
fun setAutoSnappingEnabled(autoSnappingEnabled: Boolean)

When auto-snapping is enabled the document scanner will take a photo automatically when a document is detected, conditions are good and the auto-snapping time-out elapses. In this mode the user can still tap the shutter button to snap a document.

Link copied to clipboard
fun setAutoSnappingSensitivity(autoSnappingSensitivity: Float)

Controls the auto-snapping speed. Sensitivity must be within the 0..1 range. A value of 1.0 triggers automatic capturing immediately, a value of 0.0 delays the automatic by 3 seconds. The default value is 0.66 (2 seconds)

Link copied to clipboard
fun setAutoSnapProgressColor(polygonAutoSnapProgressColor: Int)

The color of the outline progress animation before the snap being taken after the successful document scanning DocumentDetectionStatus.OK.

Link copied to clipboard

Enable/disable autoSnap progress animation. If polygon enabled (see setPolygonEnabled) - progress will be shown on polygon. Otherwise - on the finder view. Default value is true.

Link copied to clipboard
fun setAutoSnapProgressLineWidth(polygonProgressLineWidth: Int)

Width of the document autoSnap animation outline in Px.

Link copied to clipboard
fun setCameraBackgroundColor(cameraBackgroundColor: Int)

The color of the camera background (relevant only when the camera preview mode is CameraPreviewMode.FIT_IN).

Link copied to clipboard
fun setCameraModule(cameraModule: CameraModule)

Set supported camera module: CameraModule.BACK, CameraModule.FRONT or others. Optional. By default is CameraModule.BACK.

Link copied to clipboard
fun setCameraOverlayColor(cameraOverlayColor: Int)

Background color outside of the finder window.

Link copied to clipboard
fun setCameraPreviewMode(cameraPreviewMode: CameraPreviewMode)

Preview mode of the camera: Fit-In or Fill-In. Default value is CameraPreviewMode.FILL_IN.

Link copied to clipboard
fun setCancelButtonTitle(cancelButtonTitle: String)

Title of the cancel button.

Link copied to clipboard

Delay that camera will took before snap on auto focus complete called from camera core in ms. For some devices this callback could call even before real auto focus completed, so we need to take some delay before snapping. Usually you can set 500ms. By default it is set to 20ms.

Link copied to clipboard
fun setDocumentImageSizeLimit(documentImageHeightLimit: Int, documentImageWidthLimit: Int)

Document image size limit. Should be positives Ints. Means that if the document size will be bigger than a limit, then it will be downscaled with keeped aspectRatio. By default the limit is Int.MAX_VALUE, so there are no scaling.

Link copied to clipboard
fun setDrawPolygonShadows(drawPolygonShadows: Boolean)

Draw shadows under polygon stroke if polygon background color is transparent.

Link copied to clipboard
fun setEnableCameraButtonTitle(enableCameraButtonTitle: String)

Title of the button that opens the screen where the user can allow the usage of the camera by the app.

Link copied to clipboard
fun setEnableCameraExplanationText(enableCameraExplanationText: String)

Text that will be displayed when the app is not allowed to use the camera, prompting the user to enable the usage of the camera.

Link copied to clipboard
fun setFinderAspectRatio(finderAspectRatio: AspectRatio)

Aspect ratio of the finder window.

Link copied to clipboard

Set whether finder view should be enabled on the scanner or not.

Link copied to clipboard
fun setFinderLineColor(finderLineColor: Int)

Color of the finder window's outline.

Link copied to clipboard
fun setFinderLineWidth(finderLineWidth: Int)

Thickness of the finder window's outline in Px.

Link copied to clipboard
fun setFlashButtonHidden(flashButtonHidden: Boolean)

Controls whether the flash toggle button is hidden or not.

Link copied to clipboard
fun setFlashEnabled(flashEnabled: Boolean)

Controls whether the flash should be initially enabled. The default value is false.

Link copied to clipboard

Set whether camera should force maximum possible size of snapped picture or use maximum size that available with the same aspect ratio as preview by default set to false This parameter works only with ScanbotCameraXView enabled

Link copied to clipboard

Force of showing PolygonView and user guiding when autosnapping is disabled.

Link copied to clipboard
fun setIgnoreOrientationMismatch(ignoreOrientationMismatch: Boolean)

Sets whether to ignore the DetectionStatusOK_BUT_ORIENTAION_MISMATCH detection status. By default ignoreOrientationMismatch is not ignored.

Link copied to clipboard
fun setImageFilterType(imageFilterType: ImageFilterType)

Add default filtration for scanned document for given ImageFilterType.

Link copied to clipboard
fun setImageScale(imageScale: Float)

The image scaling factor. The factor must be within the 0..1 range. A factor of 1 means that the resulting images retain their original size. When the factor is less than 1, resulting images will be made smaller by that factor. By default the scale is 1.

Link copied to clipboard

Set scanning of documents with the aspect ratio that set to the finderAspectRatio parameter.

Link copied to clipboard
fun setOrientationLockMode(cameraOrientationMode: CameraOrientationMode)

Orientation lock mode of the camera: PORTRAIT or LANDSCAPE. By default the camera orientation is not locked.

Link copied to clipboard

The prioritization of still image quality and capturing speed. Defaults to CapturePhotoQualityPrioritization.BALANCED. If you experience lots of blurry still images try to set this property to CapturePhotoQualityPrioritization.QUALITY

Link copied to clipboard
fun setPolygonBackgroundColor(polygonBackgroundColor: Int)

The background color of the detected document outline when the document's angle, size or aspect ratio is not yet sufficiently good. (All DocumentDetectionStatus with OK_BUT_XXX).

Link copied to clipboard
fun setPolygonBackgroundColorOK(polygonBackgroundColorOK: Int)

The background color of the detected document outline when we are ready to snap DocumentDetectionStatus.OK.

Link copied to clipboard
fun setPolygonColor(polygonColor: Int)

The color of the detected document outline when the document's angle, size or aspect ratio is not yet sufficiently good. (All detection statuses in DocumentDetectionStatus that have the OK_BUT_XXX prefix).

Link copied to clipboard
fun setPolygonColorOK(polygonColorOK: Int)

The color of the detected document outline when we are ready to snap DocumentDetectionStatus.OK.

Link copied to clipboard
fun setPolygonCornerRadius(polygonCornerRadius: Int)

Radius of corners of the detected document outline.

Link copied to clipboard

Set whether polygon view should be enabled on the scanner or not.

Link copied to clipboard
fun setPolygonLineWidth(polygonLineWidth: Int)

Width of the detected document outline in Px.

Link copied to clipboard
fun setShutterButtonAutoInnerColor(shutterButtonAutoInnerColor: Int)

The foreground color of the shutter button in auto-snapping mode.

Link copied to clipboard
fun setShutterButtonAutoOuterColor(shutterButtonAutoOuterColor: Int)

The background color of the shutter button in auto-snapping mode.

Link copied to clipboard
fun setShutterButtonHidden(shutterButtonHidden: Boolean)

Controls whether the shutter button is hidden or not. If true - enable auto-snapping mode and hides the auto-snapping toggle button.

Link copied to clipboard
fun setShutterButtonManualInnerColor(shutterButtonManualInnerColor: Int)

The foreground color of the shutter button in manual mode.

Link copied to clipboard
fun setShutterButtonManualOuterColor(shutterButtonManualOuterColor: Int)

The background color of the shutter button in manual mode.

Link copied to clipboard
fun setShutterSoundEnabled(shutterSoundEnabled: Boolean)

Set camera shutter sound state. {@code true} if a sound should be played when taking a picture, {@code false} - otherwise By default, the camera plays the system-defined camera shutter sound when taking a picture.

Link copied to clipboard
fun setTextHintBadAngles(textBadAngles: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.OK_BUT_BAD_ANGLES.

Link copied to clipboard
fun setTextHintBadAspectRatio(textHintBadAspectRatio: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.OK_BUT_BAD_ASPECT_RATIO.

Link copied to clipboard
fun setTextHintNothingDetected(textHintNothingDetected: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.ERROR_NOTHING_DETECTED.

Link copied to clipboard
fun setTextHintOffCenter(textHintOffCenter: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.OK_OFF_CENTER.

Link copied to clipboard
fun setTextHintOK(textHintOK: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.OK.

Link copied to clipboard
fun setTextHintTooDark(textHintTooDark: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.ERROR_TOO_DARK.

Link copied to clipboard
fun setTextHintTooNoisy(textHintTooNoisy: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.ERROR_TOO_NOISY.

Link copied to clipboard
fun setTextHintTooSmall(textHintTooSmall: String)

Text hint that will be shown when the current detection status is DocumentDetectionStatus.OK_BUT_TOO_SMALL.

Link copied to clipboard
fun setTopBarBackgroundColor(topBarBackgroundColor: Int)

The background color of the top toolbar.

Link copied to clipboard
fun setTopBarButtonsActiveColor(topBarButtonsActiveColor: Int)

The color of all active toggle buttons in the toolbar.

Link copied to clipboard
fun setTopBarButtonsInactiveColor(topBarButtonsInactiveColor: Int)

The color of all inactive toggle buttons in the toolbar.

Link copied to clipboard

Controls whether the touch to focus feature should be enabled. Default is true.

Link copied to clipboard

Controls whether buttons should use all capitals style.

Link copied to clipboard
fun setUserGuidanceBackgroundColor(userGuidanceBackgroundColor: Int)

The background color of the user guidance hints.

Link copied to clipboard
fun setUserGuidanceTextColor(userGuidanceTextColor: Int)

The text color of the user guidance hints.