From 82d97bb380fc2729f5d62ce50811acbc3dcb8137 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 29 Jan 2019 13:20:27 +0100 Subject: [PATCH] request SD card permissions at rotating fullscreen image --- .../gallery/pro/activities/ViewPagerActivity.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 2e70b9ba7..84f9f944b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -557,6 +557,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun rotateImage(degrees: Int) { + val currentPath = getCurrentPath() + if (needsStupidWritePermissions(currentPath)) { + handleSAFDialog(currentPath) { + rotateBy(degrees) + } + } else { + rotateBy(degrees) + } + } + + private fun rotateBy(degrees: Int) { mRotationDegrees = (mRotationDegrees + degrees) % 360 getCurrentFragment()?.let { (it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees)