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, jsonData)#
static @NonNull TorchSwitchControl fromJson(@NonNull Context context,
        @NonNull String jsonData)

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 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 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 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 to use for the control button when the torch is on and the button is pressed.

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

Added in version 6.8.0

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