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.
- torchOffImage
@NonNull Bitmap getTorchOffImage()
voidsetTorchOffImage(@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()
voidsetTorchOffPressedImage(@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()
voidsetTorchOnImage(@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()
voidsetTorchOnPressedImage(@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()
voidsetContentDescriptionWhenOff(@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()
voidsetContentDescriptionWhenOn(@NonNull String value)Added in version 6.14.0
Accessibility label text used for the control button when the torch is on.
- setTorchOffImage(resId)
voidsetTorchOffImage(intresId)Added in version 6.7.0
Sets the resource to use for the control button image when the torch is off.
- setTorchOffPressedImage(resId)
voidsetTorchOffPressedImage(intresId)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)
voidsetTorchOnImage(intresId)Added in version 6.7.0
Sets the resource to use for the control button image when the torch is on.
- setTorchOnPressedImage(resId)
voidsetTorchOnPressedImage(intresId)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)
voidsetImageResource(intresId)Added in version 6.2.0
Sets the image to be used for all the the states of this control.
- updateFromJson(json)
voidupdateFromJson(@NonNull String json)Added in version 6.8.0
Updates the control according to a JSON serialization.
- 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.