make sure the flash is not on Torch mode when toggling to auto

This commit is contained in:
Tibor Kaputa 2017-03-27 09:44:18 +02:00
parent a7981fe7df
commit ffc89a8970
1 changed files with 8 additions and 1 deletions

View File

@ -472,9 +472,16 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
}
fun autoFlash() {
mParameters!!.flashMode = Camera.Parameters.FLASH_MODE_OFF
mCamera!!.parameters = mParameters
Handler().postDelayed({
mActivity.runOnUiThread {
mParameters!!.flashMode = Camera.Parameters.FLASH_MODE_AUTO
mCamera!!.parameters = mParameters
}
}, 1000)
}
fun initPhotoMode() {
stopRecording()