Camera Switch Control

Defined in package com.scandit.datacapture.core.ui

CameraSwitchControl
class CameraSwitchControl : Control

Added in version 6.10.0

Control that allows to switch between a primary and a secondary camera.

You can add this control to a view by calling DataCaptureView.addControl().

Adding a camera switch control to a view sets the primary camera as the view’s context frame source.

CameraSwitchControl()
CameraSwitchControl(context: Context,
        primaryCamera: Camera,
        secondaryCamera: Camera)

Added in version 6.10.0

Initializes a CameraSwitchControl with two cameras.

primaryCamera
val primaryCamera: Camera

Added in version 6.10.0

The primary camera. Calling DataCaptureView.addControl() sets this camera as the view’s context frame source.

secondaryCamera
val secondaryCamera: Camera

Added in version 6.10.0

The secondary camera.

primaryCameraImage
var primaryCameraImage: Bitmap

Added in version 6.10.0

The button image displayed when the primary camera is selected.

primaryCameraPressedImage
var primaryCameraPressedImage: Bitmap

Added in version 6.10.0

The button image displayed when the primary camera is selected and pressed.

secondaryCameraImage
var secondaryCameraImage: Bitmap

Added in version 6.10.0

The button image displayed when the secondary camera is selected.

secondaryCameraPressedImage
var secondaryCameraPressedImage: Bitmap

Added in version 6.10.0

The button image displayed when the secondary camera is selected and pressed.

contentDescriptionWhenWorldFacing
var contentDescriptionWhenWorldFacing: String

Added in version 6.14.0

Accessibility label text used for the button when the world facing camera is selected.

contentDescriptionWhenUserFacing
var contentDescriptionWhenUserFacing: String

Added in version 6.14.0

Accessibility label text used for the button when the user facing camera is selected.

setPrimaryCameraImage(resId)
fun setPrimaryCameraImage(resId: Int)

Added in version 6.10.0

The button image resource displayed when the primary camera is selected.

setPrimaryCameraPressedImage(resId)
fun setPrimaryCameraPressedImage(resId: Int)

Added in version 6.10.0

The button image resource displayed when the primary camera is selected and pressed.

setSecondaryCameraImage(resId)
fun setSecondaryCameraImage(resId: Int)

Added in version 6.10.0

The button image resource displayed when the secondary camera is selected.

setSecondaryCameraPressedImage(resId)
fun setSecondaryCameraPressedImage(resId: Int)

Added in version 6.10.0

The button image resource displayed when the secondary camera is selected and pressed.

defaultPrimaryCameraImage
val defaultPrimaryCameraImage: Bitmap

Added in version 6.10.0

The default button image used by the control for the primary camera. Can be used to reset to the original image.

defaultPrimaryCameraPressedImage
val defaultPrimaryCameraPressedImage: Bitmap

Added in version 6.10.0

The default button image used by the control for the primary camera while being pressed. Can be used to reset to the original image.

defaultSecondaryCameraImage
val defaultSecondaryCameraImage: Bitmap

Added in version 6.10.0

The default button image used by the control for the secondary camera. Can be used to reset to the original image.

defaultSecondaryCameraPressedImage
val defaultSecondaryCameraPressedImage: Bitmap

Added in version 6.10.0

The default button image used by the control for the secondary camera while being pressed. Can be used to reset to the original image.

updateFromJson(json)
fun updateFromJson(json: String)

Added in version 6.10.0

fromJson(context, json)
fun CameraSwitchControl.fromJson(context: Context,
        json: String): CameraSwitchControl

Added in version 6.10.0

Constructs a new camera switch control with the provided JSON serialization.