mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-06 10:03:18 +01:00
start checking device orientation only after permissions were granted
This commit is contained in:
parent
97e72417fa
commit
0d5fd22921
@ -469,8 +469,10 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
|||||||
toggleBottomButtons(false)
|
toggleBottomButtons(false)
|
||||||
}
|
}
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
|
if (hasCameraAndStoragePermission()) {
|
||||||
mOrientationEventListener.enable()
|
mOrientationEventListener.enable()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun resumeCameraItems() {
|
private fun resumeCameraItems() {
|
||||||
showToggleCameraIfNeeded()
|
showToggleCameraIfNeeded()
|
||||||
@ -541,11 +543,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
|||||||
private fun animateViews(degrees: Int) {
|
private fun animateViews(degrees: Int) {
|
||||||
val views = arrayOf<View>(toggle_camera, toggle_flash, toggle_photo_video, change_resolution, shutter, settings, last_photo_video_preview)
|
val views = arrayOf<View>(toggle_camera, toggle_flash, toggle_photo_video, change_resolution, shutter, settings, last_photo_video_preview)
|
||||||
for (view in views) {
|
for (view in views) {
|
||||||
try {
|
|
||||||
rotate(view, degrees)
|
rotate(view, degrees)
|
||||||
} catch (ignored: IllegalStateException) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user