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(@NonNull Context context,
        @NonNull Camera primaryCamera,
        @NonNull Camera secondaryCamera)

Added in version 6.10.0

Initializes a CameraSwitchControl with two cameras.

primaryCamera#
@NonNull Camera getPrimaryCamera()

Added in version 6.10.0

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

secondaryCamera#
@NonNull Camera getSecondaryCamera()

Added in version 6.10.0

The secondary camera.

primaryCameraImage#
@NonNull Bitmap getPrimaryCameraImage()
void setPrimaryCameraImage(@NonNull Bitmap value)

Added in version 6.10.0

The button image displayed when the primary camera is selected.

primaryCameraPressedImage#
@NonNull Bitmap getPrimaryCameraPressedImage()
void setPrimaryCameraPressedImage(@NonNull Bitmap value)

Added in version 6.10.0

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

secondaryCameraImage#
@NonNull Bitmap getSecondaryCameraImage()
void setSecondaryCameraImage(@NonNull Bitmap value)

Added in version 6.10.0

The button image displayed when the secondary camera is selected.

secondaryCameraPressedImage#
@NonNull Bitmap getSecondaryCameraPressedImage()
void setSecondaryCameraPressedImage(@NonNull Bitmap value)

Added in version 6.10.0

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

setPrimaryCameraImage(resId)#
void setPrimaryCameraImage(int resId)

Added in version 6.10.0

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

setPrimaryCameraPressedImage(resId)#
void setPrimaryCameraPressedImage(int resId)

Added in version 6.10.0

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

setSecondaryCameraImage(resId)#
void setSecondaryCameraImage(int resId)

Added in version 6.10.0

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

setSecondaryCameraPressedImage(resId)#
void setSecondaryCameraPressedImage(int resId)

Added in version 6.10.0

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

defaultPrimaryCameraImage#
@NonNull Bitmap getDefaultPrimaryCameraImage()

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#
@NonNull Bitmap getDefaultPrimaryCameraPressedImage()

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#
@NonNull Bitmap getDefaultSecondaryCameraImage()

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#
@NonNull Bitmap getDefaultSecondaryCameraPressedImage()

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(jsonData)#
void updateFromJson(@NonNull String jsonData)

Added in version 6.10.0

fromJson(context, jsonData)#
static @NonNull CameraSwitchControl fromJson(@NonNull Context context,
        @NonNull String jsonData)

Added in version 6.10.0

Constructs a new camera switch control with the provided JSON serialization. See Serialization for details.