Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
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 Cordova
Classes | |
enum | CameraSwitchVisibility |
enum | GuiStyle |
Public Member Functions | |
void | setGuiStyle (GuiStyle guiStyle) |
Sound Configuration | |
Customize the scan sound. | |
void | setBeepEnabled (boolean enabled) |
void | setVibrateEnabled (boolean enabled) |
Torch Configuration | |
Enable and customize appearance of the torch icon. | |
void | setTorchEnabled (boolean enabled) |
void | setTorchButtonMarginsAndSize (int leftMargin, int topMargin, int width, int height) |
void | setTorchButtonOffAccessibility (String label, String hint) |
void | setTorchButtonOnAccessibility (String label, String hint) |
Camera Switch Configuration | |
Enable camera switch and set icons | |
void | setCameraSwitchVisibility (CameraSwitchVisibility visibility) |
void | setCameraSwitchButtonMarginsAndSize (int rightMargin, int topMargin, int width, int height) |
void | setCameraSwitchButtonBackAccessibility (String label, String hint) |
void | setCameraSwitchButtonFrontAccessibility (String label, String hint) |
Viewfinder Configuration | |
Customize the viewfinder where the barcode location is highlighted. | |
void | setViewfinderDimension (number width, number height, number landscapeWidth, number landscapeHeight) |
void | setViewfinderColor (String hexColor) |
void | setViewfinderDecodedColor (String hexColor) |
Search Bar Configuration | |
Customize the search bar. | |
void | showSearchBar (boolean show) |
void | setSearchBarActionButtonCaption (String caption) |
void | setSearchBarPlaceholderText (String text) |
Tool Bar Configuration | |
Customize the tool bar (iOS only). | |
void | setToolBarButtonCaption (String caption) |
Non-Official Methods | |
void | setProperty (String key, Object value) |
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.
- Since
- 4.11.0
Class Documentation
enum Scandit::ScanOverlay::CameraSwitchVisibility |
enum Scandit::ScanOverlay::GuiStyle |
Scan UI style.
Member Function Documentation
void setGuiStyle | ( | GuiStyle | guiStyle | ) |
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 Scandit.ScanOverlay.GuiStyle.DEFAULT, Scandit.ScanOverlay.GuiStyle.LASER or Scandit.ScanOverlay.GuiStyle.NONE. By default this is Scandit.ScanOverlay.GuiStyle.DEFAULT.
- Since
- 4.11.0
void setBeepEnabled | ( | boolean | enabled | ) |
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.11.0
- Parameters
-
enabled Whether the beep is enabled.
void setVibrateEnabled | ( | boolean | enabled | ) |
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.11.0
- Parameters
-
enabled Whether vibrate is enabled.
void setTorchEnabled | ( | boolean | enabled | ) |
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.11.0
- Parameters
-
enabled Whether the torch button should be shown.
void setTorchButtonMarginsAndSize | ( | int | leftMargin, |
int | topMargin, | ||
int | width, | ||
int | height | ||
) |
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.11.0
- Parameters
-
leftMargin Left margin in points. topMargin Top margin in points. width Width in points. height Height in points.
void setTorchButtonOffAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the torch button while the torch is off.
The accessibility label and hint give vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently Off)", the default hint "Double-tap to switch the torch on". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setTorchButtonOnAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the torch button while the torch is on.
The accessibility label and hint give vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently On)", the default hint "Double-tap to switch the torch off". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setCameraSwitchVisibility | ( | CameraSwitchVisibility | visibility | ) |
Sets when the camera switch button is visible for devices that have more than one camera.
By default it is Scandit.ScanOverlay.CameraSwitchVisibility.NEVER.
- Since
- 4.11.0
- Parameters
-
visibility The visibility of the camera switch button (Scandit.ScanOverlay.CameraSwitchVisibility.NEVER, Scandit.ScanOverlay.CameraSwitchVisibility.ON_TABLET, Scandit.ScanOverlay.CameraSwitchVisibility.ALWAYS)
void setCameraSwitchButtonMarginsAndSize | ( | int | rightMargin, |
int | topMargin, | ||
int | width, | ||
int | height | ||
) |
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
- 4.11.0
- Parameters
-
rightMargin Right margin in dp. topMargin Top margin in dp. width Width in dp. height Height in dp.
void setCameraSwitchButtonBackAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the camera switch button while the back-facing camera is active.
The accessibility label and hint give vision-impaired users voice over guidance for the camera switch button while the back-facing camera is active. The default label is "Camera Switch (Currently back-facing)", the default hint "Double-tap to switch to the front-facing camera". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setCameraSwitchButtonFrontAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the camera switch button while the front-facing camera is active.
The accessibility label and hint give vision-impaired users voice over guidance for the camera switch button while the front-facing camera is active. The default label is "Camera Switch (Currently front-facing)", the default hint "Double-tap to switch to the back-facing camera". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setViewfinderDimension | ( | number | width, |
number | height, | ||
number | landscapeWidth, | ||
number | landscapeHeight | ||
) |
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.setScanningHotSpot(number, number)
- ScanSettings.setScanningHotSpotHeight(number)
By default the width is 0.8, height is 0.4, landscapeWidth is 0.6, landscapeHeight is 0.4
- Since
- 4.11.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.
void setViewfinderColor | ( | String | hexColor | ) |
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.11.0
- Parameters
-
hexColor String of the color's hex value ("FF0000" for red, "00FF00" for green).
void setViewfinderDecodedColor | ( | String | hexColor | ) |
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.11.0
- Parameters
-
hexColor String of the color's hex value ("FF0000" for red, "00FF00" for green).
void showSearchBar | ( | boolean | show | ) |
Shows (or hides) a search bar at the top of the scan screen.
The search bar allows the user to manually enter the data of a barcode. When the user finished entering data, the manual callback provided to the BarcodePicker.show method is invoked with the entered data as a string.
- Since
- 4.11.0
- Parameters
-
show Whether the search bar should be visible.
void setSearchBarActionButtonCaption | ( | String | caption | ) |
Sets the caption of the search button at the top of the numerical keyboard.
By default this is: "Go"
- Since
- 4.11.0
- Parameters
-
caption Caption of the search button.
void setSearchBarPlaceholderText | ( | String | text | ) |
Sets the text shown in the manual entry field when nothing has been entered yet.
To take effect this has to be called after showSearchBar().
By default this is: "Scan barcode or enter it here"
- Since
- 4.11.0
- Parameters
-
text A placeholder text shown when the search bar is empty.
void setToolBarButtonCaption | ( | String | caption | ) |
Sets the button caption of the cancel button on the tool bar.
By default this is: "Cancel"
- Since
- 4.13.0
- Parameters
-
caption The cancel button's caption.
void setProperty | ( | String | key, |
Object | value | ||
) |
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.
- Since
- 4.11.0
- Parameters
-
key The name of the property value the value for the property.