Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Android
Inherits RelativeLayout.
Public Member Functions | |
abstract void | setGuiStyle (int guiStyle) |
Sound Configuration | |
Customize the scan sound. | |
abstract void | setBeepEnabled (boolean enabled) |
abstract void | setVibrateEnabled (boolean enabled) |
Torch Configuration | |
Enable and customize appearance of the torch icon. | |
abstract void | setTorchEnabled (boolean enabled) |
abstract void | setTorchOnImage (Bitmap image) |
abstract void | setTorchOnImage (Bitmap image, Bitmap pressedImage) |
abstract void | setTorchOffImage (Bitmap image) |
abstract void | setTorchOffImage (Bitmap image, Bitmap pressedImage) |
abstract void | setTorchButtonMarginsAndSize (int leftMargin, int topMargin, int width, int height) |
abstract void | setTorchOffContentDescription (String contentDescription) |
abstract void | setTorchOnContentDescription (String contentDescription) |
Camera Switch Configuration | |
Enable camera switch and set icons | |
abstract void | setCameraSwitchVisibility (int visibility) |
abstract void | setCameraSwitchImage (Bitmap image, Bitmap pressedImage) |
abstract void | setCameraSwitchButtonMarginsAndSize (int rightMargin, int topMargin, int width, int height) |
abstract void | setCameraSwitchBackContentDescription (String contentDescription) |
abstract void | setCameraSwitchFrontContentDescription (String contentDescription) |
Text Recognition Switch Configuration | |
Customize the viewfinder where the barcode location is highlighted. | |
abstract void | setTextRecognitionSwitchVisible (boolean visible) |
Viewfinder Configuration | |
Customize the viewfinder where the barcode location is highlighted. | |
abstract void | drawViewfinder (boolean draw) |
abstract void | setViewfinderDimension (float width, float height, float landscapeWidth, float landscapeHeight) |
abstract void | setViewfinderPortraitDimension (float width, float height) |
abstract void | setViewfinderLandscapeDimension (float width, float height) |
abstract void | setViewfinderColor (float r, float g, float b) |
abstract void | setViewfinderDecodedColor (float r, float g, float b) |
abstract void | setMatrixScanHighlightingColor (int state, int color) |
Non-Official Methods | |
abstract void | setProperty (String key, Object value) |
Static Public Attributes | |
Camera Switch Button Visibility | |
static final int | CAMERA_SWITCH_NEVER |
static final int | CAMERA_SWITCH_ON_TABLET |
static final int | CAMERA_SWITCH_ALWAYS |
Scan UI style | |
static final int | GUI_STYLE_DEFAULT |
static final int | GUI_STYLE_LASER |
static final int | GUI_STYLE_NONE |
static final int | GUI_STYLE_MATRIX_SCAN |
Highlighting states of tracked barcodes (MatrixScan) | |
static final int | MATRIX_SCAN_HIGHLIGHTING_STATE_LOCALIZED |
static final int | MATRIX_SCAN_HIGHLIGHTING_STATE_RECOGNIZED |
static final int | MATRIX_SCAN_HIGHLIGHTING_STATE_REJECTED |
Detailed Description
Abstract scan UI class.
The ScanOverlay implements the scan UI displayed on top of the video feed. It is responsible for highlighting barcodes and draw the viewfinder rectangle or laser UI.
Member Function Documentation
|
abstract |
The GUI style drawn to display the indicator where the code should be scanned and the visualization of recognized codes.
- Parameters
-
guiStyle Must be one of GUI_STYLE_DEFAULT, GUI_STYLE_LASER or GUI_STYLE_NONE. By default this is GUI_STYLE_DEFAULT.
- Since
- 4.9.0
|
abstract |
Enables (or disables) the sound when a barcode is recognized.
If the phone's ring mode is set to muted or vibrate, no beep will be played regardless of the value.
Enabled by default.
- Since
- 4.9.0
- Parameters
-
enabled Whether the beep is enabled.
|
abstract |
Enables or disables the vibration when a code was recognized.
If the phone's ring mode is set to muted, no beep will be played regardless of the value.
Enabled by default.
- Since
- 4.9.0
- Parameters
-
enabled Whether vibrate is enabled.
|
abstract |
Enables or disables the torch toggle button for all devices/cameras that support a torch.
By default it is enabled. The torch icon is never shown when the camera does not have a torch (most tablets, front cameras, etc).
- Since
- 4.9.0
- Parameters
-
enabled Whether the torch button should be shown.
|
abstract |
Sets the image which is being drawn when the torch is on.
If you want this to be displayed in proper resolution on high resolution screens, you need to provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is on.
|
abstract |
Sets the images which are being drawn when the torch is on.
If you want this to be displayed in proper resolution on high resolution screens, you need to provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is on. pressedImage The new image for when the torch is on and it is pressed.
|
abstract |
Sets the image which is being drawn when the torch is off.
If you want this to be displayed in proper resolution on high resolution screens, you need to provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is off.
|
abstract |
Sets the images which are being drawn when the torch is off.
If you want this to be displayed in proper resolution on high resolution screens, you need to provide a resource big enough to work with at least xhdpi resolution.
- Since
- 4.9.0
- Parameters
-
image The new image for when the torch is off. pressedImage The new image for when the torch is off and it is pressed.
|
abstract |
Sets the position at which the button to enable the torch is drawn.
By default the margins are 15 and width and height are 40.
- Since
- 4.7.0
- Parameters
-
leftMargin Left margin in points. topMargin Top margin in points. width Width in points. height Height in points.
|
abstract |
Sets the content description for the torch button while the torch is off.
The content description gives vision-impaired users voice over guidance for the torch button while the torch is turned off. The default label is "Torch Switch (Currently Off)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
|
abstract |
Sets the content description for the torch button while the torch is on.
The content description gives vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently On)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
|
abstract |
Sets when the camera switch button is visible for devices that have more than one camera.
By default it is CAMERA_SWITCH_NEVER.
- Since
- 4.9.0
- Parameters
-
visibility The visibility of the camera switch button (.CAMERA_SWITCH_NEVER, CAMERA_SWITCH_ON_TABLET, CAMERA_SWITCH_ALWAYS)
|
abstract |
Sets the images which are being drawn when the camera switch button is visible.
If you want this to be displayed in proper resolution on high resolution screens, you need to also provide a resource with the same name but @2x appended and in higher resolution (like flash). ligh t-tur n-on -icon @2x. png
File needs to be placed in Resources folder.
By default this is: "camera-swap-icon.png" and "camera-swap-icon-pressed.png"
- Since
- 4.9.0
- Parameters
-
image The new image for the camera swap button. pressedImage The new image for the camera swap button when it is pressed.
|
abstract |
Sets the position at which the button to switch the camera is drawn.
By default the margins are 15 and width and height are 40.
- Since
- 3.0.0
- Parameters
-
rightMargin Right margin in dp. topMargin Top margin in dp. width Width in dp. height Height in dp.
|
abstract |
Sets the content description for the camera switch button while the back-facing camera is active.
The content description gives vision-impaired users voice over guidance for the camera switch button while the back-facing camera is active. The default description is "Camera Switch (Currently back-facing)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
|
abstract |
Sets the content description for the camera switch button while the front-facing camera is active.
The content description gives vision-impaired users voice over guidance for the camera switch button while the front-facing camera is active. The default description is "Camera Switch (Currently front-facing)".
- Since
- 4.9.0
- Parameters
-
contentDescription The content description.
|
abstract |
Sets whether the button to switch between different recognition modes should be visible.
If The scanner only supports one recognition mode the button is never shown.
- Parameters
-
visible Whether the button should be visible.
- Since
- 5.2.0
|
abstract |
Note: This feature is only available with the Scandit SDK Enterprise Packages.
By default this is enabled.
- Since
- 4.9.0
- Parameters
-
draw Whether the viewfinder rectangle should be drawn.
|
abstract |
Sets the size of the viewfinder relative to the size of the screen size.
Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.
- See also
- ScanSettings.enableRestrictedAreaScanning(boolean)
- ScanSettings.setScanningHotSpot(float, float)
- ScanSettings.setScanningHotSpotHeight(float)
By default the width is 0.8, height is 0.4, landscapeWidth is 0.6, landscapeHeight is 0.4
- Since
- 4.9.0
- Parameters
-
width Width of the viewfinder rectangle in portrait orientation. height Height of the viewfinder rectangle in portrait orientation. landscapeWidth Width of the viewfinder rectangle in landscape orientation. landscapeHeight Height of the viewfinder rectangle in landscape orientation.
|
abstract |
Sets the size of the viewfinder relative to the size of the screen size in portrait orientation.
Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.
- See also
- ScanSettings.enableRestrictedAreaScanning(boolean)
- ScanSettings.setScanningHotSpot(float, float)
- ScanSettings.setScanningHotSpotHeight(float)
By default the width is 0.8, height is 0.4
- Since
- 4.16.0
- Parameters
-
width Width of the viewfinder rectangle in portrait orientation. height Height of the viewfinder rectangle in portrait orientation.
|
abstract |
Sets the size of the viewfinder relative to the size of the screen size in landscape orientation.
Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.
- See also
- ScanSettings.enableRestrictedAreaScanning(boolean)
- ScanSettings.setScanningHotSpot(float, float)
- ScanSettings.setScanningHotSpotHeight(float)
By default the width is 0.6, height is 0.4
- Since
- 4.16.0
- Parameters
-
width Width of the viewfinder rectangle in landscape orientation. height Height of the viewfinder rectangle in landscape orientation.
|
abstract |
Sets the color of the viewfinder before a bar code has been recognized.
Note: This feature is only available with the Scandit SDK Enterprise Packages.
By default this is: white (1.0, 1.0, 1.0)
- Since
- 4.9.0
- Parameters
-
r Red component (between 0.0 and 1.0). g Green component (between 0.0 and 1.0). b Blue component (between 0.0 and 1.0).
|
abstract |
Sets the color of the viewfinder once the bar code has been recognized.
Note: This feature is only available with the Scandit SDK Enterprise Packages.
By default this is: light blue (0.222, 0.753, 0.8)
- Since
- 4.9.0
- Parameters
-
r Red component (between 0.0 and 1.0). g Green component (between 0.0 and 1.0). b Blue component (between 0.0 and 1.0).
|
abstract |
Sets the color of the highlighting in the specified tracking state (MatrixScan).
- Since
- 5.2.0
- Parameters
-
state A highlighting state. Must be one of MATRIX_SCAN_HIGHLIGHTING_STATE_LOCALIZED, MATRIX_SCAN_HIGHLIGHTING_STATE_RECOGNIZED, MATRIX_SCAN_HIGHLIGHTING_STATE_REJECTED. color A color.
|
abstract |
Set custom property.
This function is for internal use/and or experimental features and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not use this method unless you specifically have to.
- Parameters
-
key The name of the property value the value for the property.
Member Data Documentation
|
static |
The camera switch button is always hidden.
|
static |
The camera switch button is shown on tablet devices with front and back cameras.
|
static |
The camera switch button is shown on all devices that have front and back cameras.
|
static |
A rectangular viewfinder with rounded corners is shown in the specified size.
Recognized codes are marked with four corners.
|
static |
A laser line is shown with the specified width while the height is not changeable.
This mode should generally not be used if the recognition is running on the whole screen as it indicates that the code should be placed at the location of the laser line.
|
static |
No UI is shown to indicate where the barcode should be placed.
Be aware that the Scandit logo continues to be displayed as showing it is part of the license agreement.
|
static |
The MatrixScan UI is shown.
In order to use this UI, it is required to set ScanSettings::setMatrixScanEnabled(boolean) to true. Only available on Android version 11 and up.
- See also
- ScanSettings::setMatrixScanEnabled(boolean)
- setMatrixScanHighlightingColor(int, int)
|
static |
State for tracked barcodes that have been localized, but not recognized yet.
- Since
- 5.2.0
|
static |
State for tracked barcodes that have been recognized.
- Since
- 5.2.0
|
static |
State for tracked barcodes that have been rejected with ScanSession.rejectTrackedCode.
- Since
- 5.2.0
The documentation for this class was generated from the following file:
- ScanOverlay.java