Class BarcodeScannerConfiguration
-
- All Implemented Interfaces:
public final class BarcodeScannerConfigurationClass 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 classBarcodeScannerConfiguration.Companion
-
Field Summary
Fields Modifier and Type Field Description private final BarcodeScannerJsonConfigurationparamsprivate final BarcodeScannerNativeConfigurationnativeParamspublic final static BarcodeScannerConfiguration.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description BarcodeScannerConfiguration()
-
Method Summary
Modifier and Type Method Description final BarcodeScannerJsonConfigurationgetParams()final BarcodeScannerNativeConfigurationgetNativeParams()final UnitsetDelayAfterFocusCompleteMs(Long delay)Delay that camera will took before snap on auto focus complete called from camera core in ms. final UnitsetDelayAfterScanMs(Long milliseconds)Sets delay after scan in ms. final UnitsetConfirmationDialogConfiguration(BarcodeConfirmationDialogConfiguration configuration)Controls the state of the Barcode confirmation dialog. final UnitsetBarcodeFilter(IBarcodeFilter barcodeFilter)Additional filter to reject or accept barcode scanner results. final UnitsetBarcodeFormatsFilter(List<BarcodeFormat> barcodeFormat)A list of barcodes that the scanner should recognize. final UnitsetEngineMode(BarcodeScannerEngineMode engineMode)Allows to set custom BarcodeScannerEngineMode for the barcode scanning. final UnitsetExtractedDocumentFormats(ArrayList<BarcodeDocumentFormat> documentFormats)A list of document formats that the scanner should recognize. final UnitsetFlashEnabled(Boolean flashEnabled)Controls whether the flash should be initially enabled. final UnitsetOrientationLockMode(CameraOrientationMode cameraOrientationMode)Orientation lock mode of the camera: CameraOrientationMode.PORTRAIT or CameraOrientationMode.LANDSCAPE. final UnitsetSuccessBeepEnabled(Boolean successBeepEnabled)Controls whether to play a beep sound after a successful scanning. final UnitsetTopBarBackgroundColor(Integer topBarBackgroundColor)Background color of the top toolbar. final UnitsetTopBarButtonsColor(Integer topBarButtonsColor)Color of the titles of all buttons in the top toolbar. final UnitsetTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)The color of the inactive flash button in the toolbar. final UnitsetCameraOverlayColor(Integer cameraOverlayColor)Background color outside of the finder window. final UnitsetViewFinderEnabled(Boolean viewFinderEnabled)Set trueto enable showing the area of interest on camera preview.final UnitsetFinderAspectRatio(AspectRatio finderAspectRatio)Aspect ratio of the finder window. final UnitsetFinderLineWidth(Integer finderLineWidth)Thickness of the finder window's outline in Px. final UnitsetFinderLineColor(Integer finderLineColor)Color of the finder window's outline. final UnitsetFinderTextHintColor(Integer finderTextHintColor)Color of the text hint under the finder window. final UnitsetUseButtonsAllCaps(Boolean allCaps)Controls whether buttons should use all capitals style. final UnitsetAutoCancelTimeout(Integer seconds)Sets auto close timer in seconds. final UnitsetCameraZoomRatio(Float zoomFactor)Set current zoom ratio from 0.5xup to100x(if supported).final UnitsetCameraZoomRange(ZoomRange zoomRange)Set custom camera zoom range. final UnitsetCameraModule(CameraModule cameraModule)Set supported camera module: CameraModule.BACK, CameraModule.FRONT. final UnitsetCameraPreviewMode(CameraPreviewMode cameraPreviewMode)Preview mode of the camera: CameraPreviewMode.FILL_IN or CameraPreviewMode.FIT_IN. final UnitsetMinFocusDistanceLock(Boolean lock)Locks the minimal supported focus distance and disables a continuous focus. final UnitsetCancelButtonTitle(String cancelButtonTitle)Title of the cancel button. final UnitsetCancelButtonIcon(Integer cancelButtonIcon)Icon of the cancel button. final UnitsetFinderTextHint(String finderTextHint)Text hint shown under the finder window. final UnitsetEnableCameraExplanationText(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 UnitsetEnableCameraButtonTitle(String enableCameraButtonTitle)Title of the button that opens the screen where the user can allow the usage of the camera by the app. final UnitsetAdditionalScanningParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)Sets additional configuration for BarcodeScanner to further tweak it's logic. final UnitsetSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration)Controls the state of the Barcode selection overlay. final UnitsetInitialScanDelayMs(Long milliseconds)Sets initial scan delay in ms. final UnitsetTouchToFocusEnabled(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
trueto 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.5xup 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.5fand 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- iftrueminimal 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.
-
-
-
-