request SD card permissions at rotating fullscreen image

This commit is contained in:
tibbi 2019-01-29 13:20:27 +01:00
parent bffa42fe65
commit 82d97bb380
1 changed files with 11 additions and 0 deletions

View File

@ -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)