mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-18 13:00:36 +01:00
Merge pull request #2257 from Aga-C/add-rotate-permission
Fixed missing permission for rotate on external memory (#2236)
This commit is contained in:
commit
aea7252b16
@ -311,12 +311,11 @@ class MediaAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun rotateSelection(degrees: Int) {
|
private fun handleRotate(paths: List<String>, degrees: Int) {
|
||||||
|
var fileCnt = paths.size
|
||||||
|
rotatedImagePaths.clear()
|
||||||
activity.toast(R.string.saving)
|
activity.toast(R.string.saving)
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val paths = getSelectedPaths().filter { it.isImageFast() }
|
|
||||||
var fileCnt = paths.size
|
|
||||||
rotatedImagePaths.clear()
|
|
||||||
paths.forEach {
|
paths.forEach {
|
||||||
rotatedImagePaths.add(it)
|
rotatedImagePaths.add(it)
|
||||||
activity.saveRotatedImageToFile(it, it, degrees, true) {
|
activity.saveRotatedImageToFile(it, it, degrees, true) {
|
||||||
@ -332,6 +331,20 @@ class MediaAdapter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun rotateSelection(degrees: Int) {
|
||||||
|
val paths = getSelectedPaths().filter { it.isImageFast() }
|
||||||
|
|
||||||
|
if (paths.any { activity.needsStupidWritePermissions(it) }) {
|
||||||
|
activity.handleSAFDialog(paths.first { activity.needsStupidWritePermissions(it) }) {
|
||||||
|
if (it) {
|
||||||
|
handleRotate(paths, degrees)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleRotate(paths, degrees)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun moveFilesTo() {
|
private fun moveFilesTo() {
|
||||||
activity.handleDeletePasswordProtection {
|
activity.handleDeletePasswordProtection {
|
||||||
copyMoveTo(false)
|
copyMoveTo(false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user