SparkScan View

Defined in namespace Scandit.DataCapture.Barcode.Spark.UI

SparkScanScanningBehavior

Added in version 6.16.0

The capture mode type of the SparkScanView.

Single

Added in version 6.16.0

Barcode capturing session is stopped after each scan.

Continuous

Added in version 6.16.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.Feedback. 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.

ISparkScanScanningMode
interface ISparkScanScanningMode

Added in version 6.16.0

The base class for setting a default scanning mode to SparkScanViewSettings. Can be either SparkScanScanningModeTarget or SparkScanScanningModeDefault.

SparkScanScanningModeTarget
class SparkScanScanningModeTarget : ISparkScanScanningMode

Added in version 6.16.0

Target scanning mode. This is meant and optimized to scan codes further away.

SparkScanScanningModeTarget()
SparkScanScanningModeTarget(SparkScanScanningBehavior scanningBehavior, SparkScanPreviewBehavior previewBehavior)

Added in version 6.23.0

Constructs a new target scanning mode with the provided capture mode and preview behavior.

ScanningBehavior
SparkScanScanningBehavior ScanningBehavior { get; }

Added in version 6.16.0

The scanning mode provided in the constructor.

PreviewBehavior
SparkScanPreviewBehavior PreviewBehavior { get; }

Added in version 6.23.0

The preview behavior provided in the constructor.

SparkScanScanningModeDefault
class SparkScanScanningModeDefault : ISparkScanScanningMode

Added in version 6.16.0

This is the standard scanning mode for SparkScan.

SparkScanScanningModeDefault()
SparkScanScanningModeDefault(SparkScanScanningBehavior scanningBehavior, SparkScanPreviewBehavior previewBehavior)

Added in version 6.23.0

Constructs a new default scanning mode with the provided capture mode and preview behavior.

ScanningBehavior
SparkScanScanningBehavior ScanningBehavior { get; }

Added in version 6.16.0

The scanning mode provided in the constructor.

PreviewBehavior
SparkScanPreviewBehavior PreviewBehavior { get; }

Added in version 6.23.0

The preview behavior provided in the constructor.

SparkScanCoordinatorLayout
class SparkScanCoordinatorLayout

Added in version 6.16.0

SparkScanCoordinatorLayout is a FrameLayout.

SparkScanCoordinatorLayout is intended to be used as a container of your layout and where the SparkScanView will be used.

SparkScanCoordinatorLayout()
SparkScanCoordinatorLayout(Context context)

Added in version 6.16.0

Public constructor of the SparkScanCoordinatorLayout.

SparkScanCoordinatorLayout()
SparkScanCoordinatorLayout(Context context, IAttributeSet attrs)

Added in version 6.16.0

Public constructor of the SparkScanCoordinatorLayout.

SparkScanCoordinatorLayout()
SparkScanCoordinatorLayout(Context context, IAttributeSet attrs, int defStyleAttr)

Added in version 6.16.0

Public constructor of the SparkScanCoordinatorLayout.

<com.scandit.datacapture.barcode.spark.ui.SparkScanCoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    // Your layout goes here

</com.scandit.datacapture.barcode.spark.ui.SparkScanCoordinatorLayout>
SparkScanViewEventArgs
class SparkScanViewEventArgs : EventArgs

Added in version 6.16.0

Provides data for the SparkScanView.BarcodeCountButtonTapped and SparkScanView.BarcodeFindButtonTapped events.

SparkScanViewEventArgs()
SparkScanViewEventArgs(SparkScanView view)

Added in version 6.16.0

View
SparkScanView View { get; }

Added in version 6.16.0

SparkScanViewStateEventArgs
class SparkScanViewStateEventArgs : EventArgs

Added in version 7.0.0

Provides data for the SparkScanView.ViewStateChanged event.

SparkScanViewStateEventArgs()
SparkScanViewStateEventArgs(SparkScanViewState state)

Added in version 7.0.0

State
SparkScanViewState State { get; }

Added in version 7.0.0

SparkScanView
class SparkScanView : RelativeLayout

Added in version 6.16.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

OnPause()
void OnPause()

Added in version 6.16.0

Function to call on Fragment/Activity OnPause callback. You have to call this for the correct functioning of the SparkScanView.

protected override void OnPause()
{
    base.OnPause();
    sparkScanView.OnPause()
}
OnResume()
void OnResume()

Added in version 6.16.0

Function to call on Fragment/Activity OnResume callback. You have to call this for the correct functioning of the SparkScanView.

protected override void OnResume()
{
    base.OnResume();
    sparkScanView.OnResume()
}
Feedback
ISparkScanFeedbackDelegate Feedback { get;set; }

Added in version 6.23.0

Sets the feedback delegate. If no delegate is set, the default SparkScanBarcodeFeedback.Success feedback is emitted.

HardwareTriggerSupported
static bool HardwareTriggerSupported { get; }

Added in version 6.16.0

Returns whether the device supports listening for hardware button events. This is true for devices with api >= 28.

Create()
static SparkScanView Create(View parentView, DataCaptureContext context, SparkScan sparkScan, SparkScanViewSettings settings)

Added in version 6.16.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.

SparkScanCoordinatorLayout container = this.FindViewById<SparkScanCoordinatorLayout>(Resource.Id.spark_scan_coordinator);
var sparkScanView = SparkScanView.Create(parentView: container,
                                         context: context,
                                         sparkScan: sparkScan,
                                         settings: viewSettings);
StartScanning()
void StartScanning()

Added in version 6.16.0

Starts the scanning process. You can call this method if you want to trigger the scanning process without any user interaction.

PauseScanning()
void PauseScanning()

Added in version 6.16.0

Pauses the scanning process. You can call this method if you want to trigger pausing the scanning process without any user interaction.

ShowToast()
void ShowToast(string text)

Added in version 6.18.0

Shows a toast with text inside the mini preview.

BarcodeCountButtonTapped
event EventHandler<SparkScanViewEventArgs> BarcodeCountButtonTapped

Added in version 6.16.0

Invoked whenever a barcode count button is tapped from the toolbar.

BarcodeFindButtonTapped
event EventHandler<SparkScanViewEventArgs> BarcodeFindButtonTapped

Added in version 6.26.0

Invoked whenever a barcode find button is tapped from the toolbar.

ViewStateChanged
event EventHandler<SparkScanViewStateEventArgs> ViewStateChanged

Added in version 7.0.0

Invoked whenever SparkScanViewState changes.

BarcodeCountButtonVisible
bool BarcodeCountButtonVisible { get;set; }

Added in version 6.16.0

Indicates whether the barcode count button should be shown to the user.

Default is false.

BarcodeFindButtonVisible
bool BarcodeFindButtonVisible { get;set; }

Added in version 6.26.0

Indicates whether the barcode find button should be shown to the user.

Default is false.

TargetModeButtonVisible
bool TargetModeButtonVisible { get;set; }

Added in version 6.16.0

Indicates whether the target mode button should be shown to the user.

Default is false.

ScanningBehaviorButtonVisible
bool ScanningBehaviorButtonVisible { get;set; }

Added in version 6.16.0

Indicates whether the scanning behavior button should be shown to the user.

Default is false.

TorchButtonVisible
bool TorchButtonVisible { get;set; }

Added in version 6.16.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.

ZoomSwitchControlVisible
bool ZoomSwitchControlVisible { get;set; }

Added in version 6.18.0

Indicates whether the zoom switch control should be shown to the user.

Default is true.

TriggerButtonVisible
bool TriggerButtonVisible { get;set; }

Added in version 7.0.0

Indicates whether the trigger button should be shown to the user.

Default is true.

PreviewSizeControlVisible
bool PreviewSizeControlVisible { get;set; }

Added in version 6.23.0

Indicates whether the mini preview size control should be shown to the user.

Default is true.

TorchControlVisible
bool TorchControlVisible { get;set; }

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
bool PreviewCloseControlVisible { get;set; }

Added in version 7.0.0

Indicates whether the mini preview close control should be shown to the user.

Default is true.

CameraSwitchButtonVisible
bool CameraSwitchButtonVisible { get;set; }

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
string StopCapturingText { get;set; }

Added in version 6.16.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
string StartCapturingText { get;set; }

Added in version 6.16.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
string ResumeCapturingText { get;set; }

Added in version 6.16.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
string ScanningCapturingText { get;set; }

Added in version 6.16.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
int TriggerButtonCollapsedColor { get;set; }

Added in version 7.0.0

Sets the background color of the trigger button when button is collapsed.

TriggerButtonExpandedColor
int TriggerButtonExpandedColor { get;set; }

Added in version 7.0.0

Sets the background color of the trigger button when button is expanded.

TriggerButtonAnimationColor
int TriggerButtonAnimationColor { get;set; }

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
int TriggerButtonTintColor { get;set; }

Added in version 7.0.0

Sets the trigger button tint color.

CaptureButtonBackgroundColor
int CaptureButtonBackgroundColor { get;set; }

Added in version 6.16.0

Sets the background color of the capture button.

Default is null.

Deprecated since version 7.0: Use TriggerButtonCollapsedColor and TriggerButtonExpandedColor instead.

CaptureButtonActiveBackgroundColor
int CaptureButtonActiveBackgroundColor { get;set; }

Added in version 6.16.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
int CaptureButtonTintColor { get;set; }

Added in version 6.16.0

Sets the capture button icon and text color.

Default is null.

Deprecated since version 7.0: Use TriggerButtonTintColor instead.

ToolbarBackgroundColor
int ToolbarBackgroundColor { get;set; }

Added in version 6.16.0

Sets the toolbar background color.

Default is null.

ToolbarIconActiveTintColor
int ToolbarIconActiveTintColor { get;set; }

Added in version 6.16.0

Sets the toolbar icon active color.

Default is null.

ToolbarIconInactiveTintColor
int ToolbarIconInactiveTintColor { get;set; }

Added in version 6.16.0

Sets the toolbar icon inactive color.

Default is null.

TriggerButtonImage
Bitmap TriggerButtonImage { get;set; }

Added in version 7.0.0

The image displayed in the trigger button.