mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-01 20:16:43 +01:00
Fixed missing permission for rotate on external memory (#2236)
This commit is contained in:
parent
e849c6f7c0
commit
57020626db
@ -308,24 +308,36 @@ class MediaAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun rotateSelection(degrees: Int) {
|
private fun rotateSelection(degrees: Int) {
|
||||||
activity.toast(R.string.saving)
|
val paths = getSelectedPaths().filter { it.isImageFast() }
|
||||||
ensureBackgroundThread {
|
var fileCnt = paths.size
|
||||||
val paths = getSelectedPaths().filter { it.isImageFast() }
|
rotatedImagePaths.clear()
|
||||||
var fileCnt = paths.size
|
val handleRotate = {
|
||||||
rotatedImagePaths.clear()
|
activity.toast(R.string.saving)
|
||||||
paths.forEach {
|
ensureBackgroundThread {
|
||||||
rotatedImagePaths.add(it)
|
paths.forEach {
|
||||||
activity.saveRotatedImageToFile(it, it, degrees, true) {
|
rotatedImagePaths.add(it)
|
||||||
fileCnt--
|
activity.saveRotatedImageToFile(it, it, degrees, true) {
|
||||||
if (fileCnt == 0) {
|
fileCnt--
|
||||||
activity.runOnUiThread {
|
if (fileCnt == 0) {
|
||||||
listener?.refreshItems()
|
activity.runOnUiThread {
|
||||||
finishActMode()
|
listener?.refreshItems()
|
||||||
|
finishActMode()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (paths.any { activity.needsStupidWritePermissions(it) }) {
|
||||||
|
activity.handleSAFDialog(paths.first { activity.needsStupidWritePermissions(it) }) {
|
||||||
|
if (it) {
|
||||||
|
handleRotate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleRotate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun moveFilesTo() {
|
private fun moveFilesTo() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user