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().
- fromJson(context, json)
fun TorchSwitchControl.fromJson(context: Context, json: String): TorchSwitchControl
Added in version 6.8.0
Constructs a new torch switch control with the provided JSON serialization.
- torchOffImage
var torchOffImage: Bitmap
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
var torchOffPressedImage: Bitmap
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
var torchOnImage: Bitmap
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
var torchOnPressedImage: Bitmap
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
var contentDescriptionWhenOff: String
Added in version 6.14.0
Accessibility label text used for the control button when the torch is off.
- contentDescriptionWhenOn
var contentDescriptionWhenOn: String
Added in version 6.14.0
Accessibility label text used for the control button when the torch is on.
- setTorchOffImage(resId)
fun setTorchOffImage(resId:
Int)Added in version 6.7.0
Sets the resource to use for the control button image when the torch is off.
- setTorchOffPressedImage(resId)
fun setTorchOffPressedImage(resId:
Int)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)
fun setTorchOnImage(resId:
Int)Added in version 6.7.0
Sets the resource to use for the control button image when the torch is on.
- setTorchOnPressedImage(resId)
fun setTorchOnPressedImage(resId:
Int)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)
fun setImageResource(resId:
Int)Added in version 6.2.0
Sets the image to be used for all the the states of this control.
- updateFromJson(json)
fun updateFromJson(json: String)
Added in version 6.8.0
Updates the control according to a JSON serialization.
- defaultTorchOffImage
val defaultTorchOffImage: Bitmap
Added in version 6.10.0
The default image used for the control button when the torch is off.
- defaultTorchOffPressedImage
val defaultTorchOffPressedImage: Bitmap
Added in version 6.10.0
The default image used for the control button when the torch is off and the button is pressed.