SparkScan View Settings

Defined in package com.scandit.datacapture.barcode.spark.ui

SparkScanViewSettings
class SparkScanViewSettings

Added in version 6.15.0

Warning

Changing the values of SparkScanViewSettings instance after the creation of SparkScanView does not result in applying the changed settings to the corresponding view.

SparkScanViewSettings()
SparkScanViewSettings()

Added in version 6.26.0

Constructs a new SparkScan view settings to use when creating an instance of the SparkScanView.

You can set properties after creating an instance of SparkScanViewSettings.

val settings = SparkScanViewSettings()
settings.defaultCameraPosition = CameraPosition.USER_FACING
settings.holdToScanEnabled = false
triggerButtonCollapseTimeout
var triggerButtonCollapseTimeout: TimeInterval

Added in version 6.15.0

The timeout to automatically switch to idle state. When set to negative value timeout is infinite.

Default is 5 seconds.

inactiveStateTimeout
var inactiveStateTimeout: TimeInterval

Added in version 6.23.0

The timeout to automatically stop capturing.

Default is 10 seconds.

defaultScanningMode
var defaultScanningMode: SparkScanScanningMode

Added in version 6.16.0

Sets the default scanning mode of the view.

Default is Default.

defaultTorchState
var defaultTorchState: TorchState

Added in version 6.15.0

Sets the default torch state of the camera.

Default is TorchState.OFF.

soundEnabled
var soundEnabled: Boolean

Added in version 6.16.0

Indicates whether the feedback should have sound enabled.

Default is true.

hapticEnabled
var hapticEnabled: Boolean

Added in version 6.16.0

Indicates whether the feedback should have haptics enabled.

Default is true.

holdToScanEnabled
var holdToScanEnabled: Boolean

Added in version 6.16.0

Indicates whether to keep scanning as long as the scan button is pressed.

Default is true.

hardwareTriggerEnabled
var hardwareTriggerEnabled: Boolean

Added in version 6.16.0

Sets whether the SparkScanView should react to clicks on the hardware button specified in hardwareTriggerKeyCode. Disabled by default.

Note

This feature is only available on devices with api >= 28. Whether a device supports this can be checked at runtime with the SparkScanView.hardwareTriggerSupported flag.

hardwareTriggerKeyCode
var hardwareTriggerKeyCode: Int?

Added in version 6.16.0

The button that acts as a scan trigger. Leave null to use the default button (The default button will be the dedicated HW button on XCover devices, and KeyEvent.KEYCODE_VOLUME_DOWN for other devices). This is only taken into consideration if hardwareTriggerEnabled is true.

visualFeedbackEnabled
var visualFeedbackEnabled: Boolean

Added in version 6.16.0

Indicates whether the visual feedback on scan should be displayed.

Default is true.

toastSettings
var toastSettings: SparkScanToastSettings

Added in version 6.18.0

Sets the toast settings. See SparkScanToastSettings for details.

smartSelectionCandidateBrush
var smartSelectionCandidateBrush: Brush?

Added in version 8.1.0

Sets the brush to be used for potential candidates when ScanIntention is set to ScanIntention.SMART_SELECTION in SparkScanSettings. If null, the default brush will be used.

toJson()
fun toJson(): String

Added in version 6.16.0

Returns the JSON representation of the spark scan settings.

zoomFactorOut
var zoomFactorOut: Float

Added in version 6.23.0

The zoom factor to use for the camera.

Default is 1.

zoomFactorIn
var zoomFactorIn: Float

Added in version 6.23.0

The zoom factor to move to when the zoom switch control was tapped.

Default is 2.

defaultMiniPreviewSize
var defaultMiniPreviewSize: SparkScanMiniPreviewSize

Added in version 7.0.0

Sets the default size of the mini preview.

Default is SparkScanMiniPreviewSize.REGULAR.

defaultCameraPosition
var defaultCameraPosition: CameraPosition

Added in version 6.24.0

Sets the default camera position.

Default is CameraPosition.WORLD_FACING.

Note

This API is still in beta and may change in future versions of Scandit Data Capture SDK.