Created
September 13, 2020 11:19
-
-
Save magdamiu/07698dfb30bd22993d2c2921608c65b2 to your computer and use it in GitHub Desktop.
Smile, it’s CameraX! [analysis and extensions] | Analysis - enable/disable the torch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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