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
setBarcodeImageGenerationType(BarcodeImageGenerationType imageType)
Specifies the way of barcode images generation or disables this generation at all. 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(EngineMode engineMode)
Allows to set custom EngineMode for the barcode detection EngineMode.NextGen is used by default final Unit
setAcceptedDocumentFormats(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: PORTRAIT or LANDSCAPE. final Unit
setSuccessBeepEnabled(Boolean successBeepEnabled)
Controls whether to play a beep sound after a successful detection. 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 to 100x (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 or others. final Unit
setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: Fit-In or Fill-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
setAdditionalDetectionParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)
Sets additional configuration for BarcodeDetector 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
-
setBarcodeImageGenerationType
final Unit setBarcodeImageGenerationType(BarcodeImageGenerationType imageType)
Specifies the way of barcode images generation or disables this generation at all. Use, if you want to receive a full sized image with barcodes.
Defaults to BarcodeImageGenerationType.NONE.
-
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 detection.
By default, all supported barcode formats will be recognized.
-
setEngineMode
final Unit setEngineMode(EngineMode engineMode)
Allows to set custom EngineMode for the barcode detection EngineMode.NextGen is used by default
- Parameters:
engineMode
- of the detector to use
-
setAcceptedDocumentFormats
final Unit setAcceptedDocumentFormats(ArrayList<BarcodeDocumentFormat> documentFormats)
A list of document formats that the scanner should recognize. Anything not on the list will not trigger a detection.
By default, all supported barcode document formats will be recognized.
-
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: PORTRAIT or 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 detection. 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 to 100x (if supported). Default value is 1x.
- Parameters:
zoomFactor
- Target zoom level
-
setCameraZoomRange
final Unit setCameraZoomRange(ZoomRange zoomRange)
Set custom camera zoom range. Min value 0.5f and max value 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 or others. Optional. By default is CameraModule.BACK.
-
setCameraPreviewMode
final Unit setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: Fit-In or Fill-In. Optional, default is Fill-In.
-
setMinFocusDistanceLock
final Unit setMinFocusDistanceLock(Boolean lock)
Locks the minimal supported focus distance and disables a continuous focus
- Parameters:
lock
- iftrue
minimal available focus distance will be locked,false
- otherwise Default isfalse
.
-
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.
-
setAdditionalDetectionParameters
final Unit setAdditionalDetectionParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)
Sets additional configuration for BarcodeDetector 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
.
-
-
-
-