SparkScan View
Defined under the namespace Scandit.Datacapture.Barcode.Spark.Ui
- SparkScanScanningBehavior
Added in version 6.22.0
The capture mode type of the SparkScanView.
- Single
Added in version 6.22.0
Barcode capturing session is stopped after each scan.
- Continuous
Added in version 6.22.0
Keeps the barcode capturing session active for longer time.
- SparkScanPreviewBehavior
Added in version 6.23.0
The preview behavior type of the SparkScanView.
- Default
Added in version 6.23.0
After a scan with scanning behavior SparkScanScanningBehavior.Single, or stopping scanning with scanning behavior SparkScanScanningBehavior.Continuous, camera moves to standby state and preview is hidden for maximum efficiency.
- Persistent
Added in version 6.23.0
After a scan with scanning behavior SparkScanScanningBehavior.Single, or stopping scanning with scanning behavior SparkScanScanningBehavior.Continuous, camera stays active and preview is visible for maximum precision.
- SparkScanMiniPreviewSize
Added in version 7.0.0
The size of the mini preview in SparkScanView. Used in SparkScanViewSettings.defaultMiniPreviewSize.
- Regular
Added in version 7.0.0
Regular, smaller size of the mini preview.
- Expanded
Added in version 7.0.0
Expanded, larger size of the mini preview.
- SparkScanViewState
Added in version 7.0.0
The view state of SparkScanView.
- Initial
Added in version 7.0.0
The initial view state for a few moments after SparkScanView is created.
- Idle
Added in version 7.0.0
SparkScan is displaying only the collapsed capture button.
- Inactive
Added in version 7.0.0
SparkScan is displaying an expanded capture button, and if the SparkScanPreviewBehavior of the current SparkScanScanningMode is SparkScanPreviewBehavior.Persistent, we are also displaying camera feed through the mini preview but no actual scanning is taking place. This state is reachable after scanning or after a SparkScanViewSettings.inactiveStateTimeout timeout.
- Active
Added in version 7.0.0
We are actively recognising barcodes, mini preview and expanded capture button are visible.
- Error
Added in version 7.0.0
User returns SparkScanBarcodeFeedback.Error from the SparkScanView.feedbackDelegate. Mini preview is visible with a frozen frame and expanded capture button is visible. If capture button is tapped or after a SparkScanBarcodeErrorFeedback.resumeCapturingDelay timeout is reached we move to Active state.
- SparkScanViewUiListener
interface SparkScanViewUiListener
Added in version 6.22.0
- didTapBarcodeFindButton(view)
didTapBarcodeFindButton?(view: SparkScanView):
void
Added in version 6.26.0
Callback method that can be used to define an action that should be performed when barcode find button is tapped from the toolbar. Called from the main thread.
- didTapBarcodeCountButton(view)
didTapBarcodeCountButton?(view: SparkScanView):
void
Added in version 6.22.0
Callback method that can be used to define an action that should be performed when barcode count button is tapped from the toolbar. Called from the main thread.
- didChangeViewState(newState)
didChangeViewState?(newState: SparkScanViewState):
void
Added in version 7.0.0
Callback method that will be called when SparkScanViewState changes. Called from the main thread.
- SparkScanScanningMode
interface SparkScanScanningMode
Added in version 6.22.0
The base class for setting a default scanning mode to SparkScanViewSettings. Can be either SparkScanScanningModeTarget or SparkScanScanningModeDefault.
- SparkScanScanningModeTarget
class SparkScanScanningModeTarget : SparkScanScanningMode
Added in version 6.22.0
Target scanning mode. This is meant and optimized to scan codes further away.
- constructor(scanningBehavior, previewBehavior)
constructor(scanningBehavior: SparkScanScanningBehavior, previewBehavior?: SparkScanPreviewBehavior)
Added in version 6.23.0
Constructs a new target scanning mode with the provided capture mode and preview behavior.
- scanningBehavior
get scanningBehavior(): SparkScanScanningBehavior
Added in version 6.22.0
The scanning mode provided in the constructor.
- previewBehavior
get previewBehavior(): SparkScanPreviewBehavior
Added in version 6.23.0
The preview behavior provided in the constructor.
- SparkScanScanningModeDefault
class SparkScanScanningModeDefault : SparkScanScanningMode
Added in version 6.22.0
This is the standard scanning mode for SparkScan.
- constructor(scanningBehavior, previewBehavior)
constructor(scanningBehavior: SparkScanScanningBehavior, previewBehavior?: SparkScanPreviewBehavior)
Added in version 6.23.0
Constructs a new default scanning mode with the provided capture mode and preview behavior.
- scanningBehavior
get scanningBehavior(): SparkScanScanningBehavior
Added in version 6.22.0
The scanning mode provided in the constructor.
- previewBehavior
get previewBehavior(): SparkScanPreviewBehavior
Added in version 6.23.0
The preview behavior provided in the constructor.
- SparkScanView
class SparkScanView
Added in version 6.22.0
SparkScan comes with a ready-to-use UI and scanning modes that are purpose-built to tackle high-volume scanning at close range. The SparkScanView integrates with any app without requiring app redesign or customization. It includes:
camera preview screen
large-sized scan button
quick access toolbar to adjust scanning settings
- feedbackDelegate
feedbackDelegate: SparkScanFeedbackDelegate | null
Added in version 6.23.0
Sets the feedback delegate. If no delegate is set, the default SparkScanBarcodeFeedback.Success feedback is emitted.
- forContext(context, sparkScan, settings)
static forContext(context: DataCaptureContext, sparkScan: SparkScan, settings: SparkScanViewSettings | null): SparkScanView
Added in version 6.22.0
Constructs a new SparkScan view and adds it to the provided parentView. When the settings are provided, those will be used to set the default behaviour and look of the view.
- prepareScanning()
prepareScanning():
void
Added in version 6.22.0
- stopScanning()
stopScanning():
void
Added in version 6.22.0
- startScanning()
startScanning():
void
Added in version 6.22.0
Starts the scanning process. You can call this method if you want to trigger the scanning process without any user interaction.
- pauseScanning()
pauseScanning():
void
Added in version 6.22.0
Pauses the scanning process. You can call this method if you want to trigger pausing the scanning process without any user interaction.
- showToast(text)
showToast(text: string): Promise<
void
>Added in version 6.23.0
Shows a toast with text inside the mini preview.
- defaultBrush()
static get defaultBrush(): Brush
Added in version 6.22.0
Returns the default brush used by the overlay.
- uiListener
uiListener: SparkScanViewUiListener | null
Added in version 6.22.0
Sets the listener which is called whenever a barcode find button or barcode count button is tapped from the toolbar.
- barcodeCountButtonVisible
barcodeCountButtonVisible: boolean
Added in version 6.22.0
Indicates whether the barcode count button should be shown to the user.
Default is false.
- barcodeFindButtonVisible
barcodeFindButtonVisible: boolean
Added in version 6.26.0
Indicates whether the barcode find button should be shown to the user.
Default is false.
- targetModeButtonVisible
targetModeButtonVisible: boolean
Added in version 6.22.0
Indicates whether the target mode button should be shown to the user.
Default is false.
- scanningBehaviorButtonVisible
scanningBehaviorButtonVisible: boolean
Added in version 6.22.0
Indicates whether the scanning behavior button should be shown to the user.
Default is false.
- torchButtonVisible
torchButtonVisible: boolean
Added in version 6.22.0
Indicates whether the torch button should be shown to the user.
Default is true.
Deprecated since version 7.0: The torch button has been moved to the mini preview. Use torchControlVisible instead.
- triggerButtonVisible
triggerButtonVisible: boolean
Added in version 7.0.0
Indicates whether the trigger button should be shown to the user.
Default is true.
- previewSizeControlVisible
previewSizeControlVisible: boolean
Added in version 6.23.0
Indicates whether the mini preview size control should be shown to the user.
Default is true.
- torchControlVisible
torchControlVisible: boolean
Added in version 7.0.0
Indicates whether the torch control should be shown to the user.
Default is true.
Note
If SparkScanViewSettings.defaultTorchState is set to TorchState.Auto, torch control is hidden.
- previewCloseControlVisible
previewCloseControlVisible: boolean
Added in version 7.0.0
Indicates whether the mini preview close control should be shown to the user.
Default is true.
- cameraSwitchButtonVisible
cameraSwitchButtonVisible: boolean
Added in version 6.24.0
Indicates whether the camera switch button should be shown to the user.
Default is false.
Note
This API is still in beta and may change in future versions of Scandit Data Capture SDK.
- stopCapturingText
stopCapturingText: string | null
Added in version 6.22.0
Sets the default text to display in the button for the stop capturing action.
Default is null.
Deprecated since version 7.0: The trigger button no longer displays text.
- startCapturingText
startCapturingText: string | null
Added in version 6.22.0
Sets the default text to display in the button for the start capturing action.
Default is null.
Deprecated since version 7.0: The trigger button no longer displays text.
- resumeCapturingText
resumeCapturingText: string | null
Added in version 6.22.0
Sets the default text to display in the button for the resume capturing action.
Default is null.
Deprecated since version 7.0: The trigger button no longer displays text.
- scanningCapturingText
scanningCapturingText: string | null
Added in version 6.22.0
Sets the default text to display in the button when scanning in SparkScanScanningBehavior.Single.
Default is null.
Deprecated since version 7.0: The trigger button no longer displays text.
- triggerButtonCollapsedColor
triggerButtonCollapsedColor: Color | null
Added in version 7.0.0
Sets the background color of the trigger button when button is collapsed.
- triggerButtonExpandedColor
triggerButtonExpandedColor: Color | null
Added in version 7.0.0
Sets the background color of the trigger button when button is expanded.
- triggerButtonAnimationColor
triggerButtonAnimationColor: Color | null
Added in version 7.0.0
Sets the color of the pulsing animation around the trigger button, which is shown when the scanner is active.
- triggerButtonTintColor
triggerButtonTintColor: Color | null
Added in version 7.0.0
Sets the trigger button tint color.
- captureButtonBackgroundColor
captureButtonBackgroundColor: Color | null
Added in version 6.22.0
Sets the background color of the capture button.
Default is null.
Deprecated since version 7.0: Use triggerButtonCollapsedColor and triggerButtonExpandedColor instead.
- captureButtonActiveBackgroundColor
captureButtonActiveBackgroundColor: Color | null
Added in version 6.22.0
Sets the background color of the capture button when scanning.
Default is null.
Deprecated since version 7.0: This property is not relevant anymore.
- captureButtonTintColor
captureButtonTintColor: Color | null
Added in version 6.22.0
Sets the capture button icon and text color.
Default is null.
Deprecated since version 7.0: Use triggerButtonTintColor instead.
- toolbarBackgroundColor
toolbarBackgroundColor: Color | null
Added in version 6.22.0
Sets the toolbar background color.
Default is null.
- toolbarIconActiveTintColor
toolbarIconActiveTintColor: Color | null
Added in version 6.22.0
Sets the toolbar icon active color.
Default is null.
- toolbarIconInactiveTintColor
toolbarIconInactiveTintColor: Color | null
Added in version 6.22.0
Sets the toolbar icon inactive color.
Default is null.
- triggerButtonImage
triggerButtonImage: string | null
Added in version 7.0.0
The image displayed in the trigger button.
- dispose()
dispose():
void
Added in version 6.22.0
Removes the SparkScanView from the WebView.