Class BarcodeScannerConfiguration
-
- All Implemented Interfaces:
public final class BarcodeScannerConfiguration
Class which is used to configure io.scanbot.sdk.ui.view.barcode.BarcodeScannerActivity. Contains settings indicating views Behaviour, Texts and Appearance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
BarcodeScannerConfiguration.Companion
-
Field Summary
Fields Modifier and Type Field Description private final BarcodeScannerJsonConfiguration
params
private final BarcodeScannerNativeConfiguration
nativeParams
public final static BarcodeScannerConfiguration.Companion
Companion
-
Constructor Summary
Constructors Constructor Description BarcodeScannerConfiguration()
-
Method Summary
Modifier and Type Method Description final BarcodeScannerJsonConfiguration
getParams()
final BarcodeScannerNativeConfiguration
getNativeParams()
final Unit
setDelayAfterFocusCompleteMs(Long delay)
Delay that camera will took before snap on auto focus complete called from camera core in ms. final Unit
setDelayAfterScanMs(Long milliseconds)
Sets delay after scan in ms. final Unit
setConfirmationDialogConfiguration(BarcodeConfirmationDialogConfiguration configuration)
Controls the state of the Barcode confirmation dialog. final Unit
setBarcodeFilter(IBarcodeFilter barcodeFilter)
Additional filter to reject or accept barcode scanner results. final Unit
setBarcodeFormatsFilter(List<BarcodeFormat> barcodeFormat)
A list of barcodes that the scanner should recognize. final Unit
setEngineMode(BarcodeScannerEngineMode engineMode)
Allows to set custom BarcodeScannerEngineMode for the barcode scanning. final Unit
setExtractedDocumentFormats(ArrayList<BarcodeDocumentFormat> documentFormats)
A list of document formats that the scanner should recognize. final Unit
setFlashEnabled(Boolean flashEnabled)
Controls whether the flash should be initially enabled. final Unit
setOrientationLockMode(CameraOrientationMode cameraOrientationMode)
Orientation lock mode of the camera: CameraOrientationMode.PORTRAIT or CameraOrientationMode.LANDSCAPE. final Unit
setSuccessBeepEnabled(Boolean successBeepEnabled)
Controls whether to play a beep sound after a successful scanning. final Unit
setTopBarBackgroundColor(Integer topBarBackgroundColor)
Background color of the top toolbar. final Unit
setTopBarButtonsColor(Integer topBarButtonsColor)
Color of the titles of all buttons in the top toolbar. final Unit
setTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)
The color of the inactive flash button in the toolbar. final Unit
setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside of the finder window. final Unit
setViewFinderEnabled(Boolean viewFinderEnabled)
Set true
to enable showing the area of interest on camera preview.final Unit
setFinderAspectRatio(AspectRatio finderAspectRatio)
Aspect ratio of the finder window. final Unit
setFinderLineWidth(Integer finderLineWidth)
Thickness of the finder window's outline in Px. final Unit
setFinderLineColor(Integer finderLineColor)
Color of the finder window's outline. final Unit
setFinderTextHintColor(Integer finderTextHintColor)
Color of the text hint under the finder window. final Unit
setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style. final Unit
setAutoCancelTimeout(Integer seconds)
Sets auto close timer in seconds. final Unit
setCameraZoomRatio(Float zoomFactor)
Set current zoom ratio from 0.5x
up to100x
(if supported).final Unit
setCameraZoomRange(ZoomRange zoomRange)
Set custom camera zoom range. final Unit
setCameraModule(CameraModule cameraModule)
Set supported camera module: CameraModule.BACK, CameraModule.FRONT. final Unit
setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: CameraPreviewMode.FILL_IN or CameraPreviewMode.FIT_IN. final Unit
setMinFocusDistanceLock(Boolean lock)
Locks the minimal supported focus distance and disables a continuous focus. final Unit
setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button. final Unit
setCancelButtonIcon(Integer cancelButtonIcon)
Icon of the cancel button. final Unit
setFinderTextHint(String finderTextHint)
Text hint shown under the finder window. final Unit
setEnableCameraExplanationText(String enableCameraExplanationText)
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. final Unit
setEnableCameraButtonTitle(String enableCameraButtonTitle)
Title of the button that opens the screen where the user can allow the usage of the camera by the app. final Unit
setAdditionalScanningParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)
Sets additional configuration for BarcodeScanner to further tweak it's logic. final Unit
setSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration)
Controls the state of the Barcode selection overlay. final Unit
setInitialScanDelayMs(Long milliseconds)
Sets initial scan delay in ms. final Unit
setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled.
-
-
-
Method Detail
-
getParams
final BarcodeScannerJsonConfiguration getParams()
-
getNativeParams
final BarcodeScannerNativeConfiguration getNativeParams()
-
setDelayAfterFocusCompleteMs
final Unit setDelayAfterFocusCompleteMs(Long delay)
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.
-
setDelayAfterScanMs
final Unit setDelayAfterScanMs(Long milliseconds)
Sets delay after scan in ms. 0 = disabled and it is the default value
-
setConfirmationDialogConfiguration
final Unit setConfirmationDialogConfiguration(BarcodeConfirmationDialogConfiguration configuration)
Controls the state of the Barcode confirmation dialog. Disabled by default.
Displays a dialog with the barcode data and allows users to confirm the scanned barcode
-
setBarcodeFilter
final Unit setBarcodeFilter(IBarcodeFilter barcodeFilter)
Additional filter to reject or accept barcode scanner results. The default value is an instance of BarcodeFilter.
-
setBarcodeFormatsFilter
final Unit setBarcodeFormatsFilter(List<BarcodeFormat> barcodeFormat)
A list of barcodes that the scanner should recognize. Anything not on the list will not trigger a successful scan.
By default, all supported barcode formats will be scanned.
-
setEngineMode
final Unit setEngineMode(BarcodeScannerEngineMode engineMode)
Allows to set custom BarcodeScannerEngineMode for the barcode scanning. BarcodeScannerEngineMode.NEXT_GEN is used by default.
- Parameters:
engineMode
- of the scanner to use
-
setExtractedDocumentFormats
final Unit setExtractedDocumentFormats(ArrayList<BarcodeDocumentFormat> documentFormats)
A list of document formats that the scanner should recognize. Anything not on the list will not trigger a successful scan.
By default, all supported barcode document formats will be scanned.
-
setFlashEnabled
final Unit setFlashEnabled(Boolean flashEnabled)
Controls whether the flash should be initially enabled. The default value is
false
.
-
setOrientationLockMode
final Unit setOrientationLockMode(CameraOrientationMode cameraOrientationMode)
Orientation lock mode of the camera: CameraOrientationMode.PORTRAIT or CameraOrientationMode.LANDSCAPE. By default the camera orientation is not locked.
-
setSuccessBeepEnabled
final Unit setSuccessBeepEnabled(Boolean successBeepEnabled)
Controls whether to play a beep sound after a successful scanning. Default value is
true
.
-
setTopBarBackgroundColor
final Unit setTopBarBackgroundColor(Integer topBarBackgroundColor)
Background color of the top toolbar.
-
setTopBarButtonsColor
final Unit setTopBarButtonsColor(Integer topBarButtonsColor)
Color of the titles of all buttons in the top toolbar.
-
setTopBarButtonsInactiveColor
final Unit setTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)
The color of the inactive flash button in the toolbar.
-
setCameraOverlayColor
final Unit setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside of the finder window.
-
setViewFinderEnabled
final Unit setViewFinderEnabled(Boolean viewFinderEnabled)
Set
true
to enable showing the area of interest on camera preview. Enabled by default.
-
setFinderAspectRatio
final Unit setFinderAspectRatio(AspectRatio finderAspectRatio)
Aspect ratio of the finder window.
-
setFinderLineWidth
final Unit setFinderLineWidth(Integer finderLineWidth)
Thickness of the finder window's outline in Px.
-
setFinderLineColor
final Unit setFinderLineColor(Integer finderLineColor)
Color of the finder window's outline.
-
setFinderTextHintColor
final Unit setFinderTextHintColor(Integer finderTextHintColor)
Color of the text hint under the finder window.
-
setUseButtonsAllCaps
final Unit setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style.
-
setAutoCancelTimeout
final Unit setAutoCancelTimeout(Integer seconds)
Sets auto close timer in seconds. 0 = disabled and it is the default value.
-
setCameraZoomRatio
final Unit setCameraZoomRatio(Float zoomFactor)
Set current zoom ratio from
0.5x
up to100x
(if supported). The default value is1x
.- Parameters:
zoomFactor
- target zoom level
-
setCameraZoomRange
final Unit setCameraZoomRange(ZoomRange zoomRange)
Set custom camera zoom range. Min value is
0.5f
and max -100f
(if supported by device). Default value is ZoomRange(0.5x, 100x).
-
setCameraModule
final Unit setCameraModule(CameraModule cameraModule)
Set supported camera module: CameraModule.BACK, CameraModule.FRONT. The default value is CameraModule.BACK.
-
setCameraPreviewMode
final Unit setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: CameraPreviewMode.FILL_IN or CameraPreviewMode.FIT_IN. The default value is CameraPreviewMode.FILL_IN.
-
setMinFocusDistanceLock
final Unit setMinFocusDistanceLock(Boolean lock)
Locks the minimal supported focus distance and disables a continuous focus. The default value is
false
.- Parameters:
lock
- iftrue
minimal available focus distance will be locked,false
- otherwise
-
setCancelButtonTitle
final Unit setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button.
-
setCancelButtonIcon
final Unit setCancelButtonIcon(Integer cancelButtonIcon)
Icon of the cancel button.
-
setFinderTextHint
final Unit setFinderTextHint(String finderTextHint)
Text hint shown under the finder window.
-
setEnableCameraExplanationText
final Unit setEnableCameraExplanationText(String enableCameraExplanationText)
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.
-
setEnableCameraButtonTitle
final Unit setEnableCameraButtonTitle(String enableCameraButtonTitle)
Title of the button that opens the screen where the user can allow the usage of the camera by the app.
-
setAdditionalScanningParameters
final Unit setAdditionalScanningParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)
Sets additional configuration for BarcodeScanner to further tweak it's logic.
NOTE: these parameters are not intended to be modified unless needed.
Documentation and default values can be seen in BarcodeScannerAdditionalConfiguration.
-
setSelectionOverlayConfiguration
final Unit setSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration)
Controls the state of the Barcode selection overlay. Disabled by default.
Displays contours of the barcode and allows users to select the barcode on a AR-like layer.
-
setInitialScanDelayMs
final Unit setInitialScanDelayMs(Long milliseconds)
Sets initial scan delay in ms. 0 = disabled and it is the default value
-
setTouchToFocusEnabled
final Unit setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. Default is
true
.
-
-