mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-04-22 11:17:25 +02: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() {
|
private fun handleTogglePhotoVideo() {
|
||||||
togglePhotoVideo()
|
togglePhotoVideo()
|
||||||
checkButtons()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun togglePhotoVideo() {
|
private fun togglePhotoVideo() {
|
||||||
if (!checkCameraAvailable()) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasRecordAudioPermission()) {
|
if (!hasRecordAudioPermission()) {
|
||||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.RECORD_AUDIO), RECORD_AUDIO_PERMISSION)
|
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.RECORD_AUDIO), RECORD_AUDIO_PERMISSION)
|
||||||
mIsAskingPermissions = true
|
mIsAskingPermissions = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!checkCameraAvailable()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (mIsVideoCaptureIntent)
|
if (mIsVideoCaptureIntent)
|
||||||
mPreview?.trySwitchToVideo()
|
mPreview?.trySwitchToVideo()
|
||||||
|
|
||||||
@ -325,6 +324,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
|||||||
hideTimer()
|
hideTimer()
|
||||||
mIsInPhotoMode = !mIsInPhotoMode
|
mIsInPhotoMode = !mIsInPhotoMode
|
||||||
showToggleCameraIfNeeded()
|
showToggleCameraIfNeeded()
|
||||||
|
checkButtons()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkButtons() {
|
private fun checkButtons() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user