Torch Switch Control

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

TorchSwitchControl
class TorchSwitchControl : Control

Added in version 6.0.0

Control that allows to toggle the torch on and off. The torch switch control hides itself automatically in case the active frame source doesn’t have a torch.

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

TorchSwitchControl()
TorchSwitchControl(@NonNull Context context)

Added in version 6.0.0

Constructor.

fromJson(context, json)
static @NonNull TorchSwitchControl fromJson(@NonNull Context context,
        @NonNull String json)

Added in version 6.8.0

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

torchOffImage
@NonNull Bitmap getTorchOffImage()
void setTorchOffImage(@NonNull Bitmap value)

Added in version 6.7.0

Sets the image encoded as a base64 string to use for the control button when the torch is off.

torchOffPressedImage
@NonNull Bitmap getTorchOffPressedImage()
void setTorchOffPressedImage(@NonNull Bitmap value)

Added in version 6.7.0

Sets the image encoded as a base64 string to use for the control button when the torch is off and the button is pressed.

torchOnImage
@NonNull Bitmap getTorchOnImage()
void setTorchOnImage(@NonNull Bitmap value)

Added in version 6.7.0

Sets the image encoded as a base64 string to use for the control button when the torch is on.

torchOnPressedImage
@NonNull Bitmap getTorchOnPressedImage()
void setTorchOnPressedImage(@NonNull Bitmap value)

Added in version 6.7.0

Sets the image encoded as a base64 string to use for the control button when the torch is on and the button is pressed.

contentDescriptionWhenOff
@NonNull String getContentDescriptionWhenOff()
void setContentDescriptionWhenOff(@NonNull String value)

Added in version 6.14.0

Accessibility label text used for the control button when the torch is off.

contentDescriptionWhenOn
@NonNull String getContentDescriptionWhenOn()
void setContentDescriptionWhenOn(@NonNull String value)

Added in version 6.14.0

Accessibility label text used for the control button when the torch is on.

setTorchOffImage(resId)
void setTorchOffImage(int resId)

Added in version 6.7.0

Sets the resource to use for the control button image when the torch is off.

setTorchOffPressedImage(resId)
void setTorchOffPressedImage(int resId)

Added in version 6.7.0

Sets the resource to use for the control button image when the torch is off and the button is pressed.

setTorchOnImage(resId)
void setTorchOnImage(int resId)

Added in version 6.7.0

Sets the resource to use for the control button image when the torch is on.

setTorchOnPressedImage(resId)
void setTorchOnPressedImage(int resId)

Added in version 6.7.0

Sets the resource to use for the control button image when the torch is on and the button is pressed.

setImageResource(resId)
void setImageResource(int resId)

Added in version 6.2.0

Sets the image to be used for all the the states of this control.

updateFromJson(json)
void updateFromJson(@NonNull String json)

Added in version 6.8.0

Updates the control according to a JSON serialization. See Serialization for details.

defaultTorchOffImage
@NonNull Bitmap getDefaultTorchOffImage()

Added in version 6.10.0

The default image used for the control button when the torch is off.

defaultTorchOffPressedImage
@NonNull Bitmap getDefaultTorchOffPressedImage()

Added in version 6.10.0

The default image used for the control button when the torch is off and the button is pressed.

defaultTorchOnImage
@NonNull Bitmap getDefaultTorchOnImage()

Added in version 6.10.0

The default image used for the control button when the torch is on.

defaultTorchOnPressedImage
@NonNull Bitmap getDefaultTorchOnPressedImage()

Added in version 6.10.0

The default image used for the control button when the torch is on and the button is pressed.