Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Smile, it’s CameraX! [analysis and extensions] | Analysis - enable/disable the torch
val cameraControl = camera.cameraControl
val cameraInfo = camera.cameraInfo
cameraInfo.torchState.observe(this, Observer { state ->
if (state == TorchState.ON) {
// state on
} else {
// state off
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.