mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-16 19:30:40 +01:00
recheck the button state after granting record audio permission
This commit is contained in:
parent
6ab9edf4ce
commit
1fe72e79cb
@ -304,20 +304,19 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
||||
|
||||
private fun handleTogglePhotoVideo() {
|
||||
togglePhotoVideo()
|
||||
checkButtons()
|
||||
}
|
||||
|
||||
private fun togglePhotoVideo() {
|
||||
if (!checkCameraAvailable()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!hasRecordAudioPermission()) {
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.RECORD_AUDIO), RECORD_AUDIO_PERMISSION)
|
||||
mIsAskingPermissions = true
|
||||
return
|
||||
}
|
||||
|
||||
if (!checkCameraAvailable()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (mIsVideoCaptureIntent)
|
||||
mPreview?.trySwitchToVideo()
|
||||
|
||||
@ -325,6 +324,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
||||
hideTimer()
|
||||
mIsInPhotoMode = !mIsInPhotoMode
|
||||
showToggleCameraIfNeeded()
|
||||
checkButtons()
|
||||
}
|
||||
|
||||
private fun checkButtons() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user