mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +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
1 changed files with 17 additions and 4 deletions
|
@ -311,12 +311,11 @@ class MediaAdapter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun rotateSelection(degrees: Int) {
|
private fun handleRotate(paths: List<String>, degrees: Int) {
|
||||||
activity.toast(R.string.saving)
|
|
||||||
ensureBackgroundThread {
|
|
||||||
val paths = getSelectedPaths().filter { it.isImageFast() }
|
|
||||||
var fileCnt = paths.size
|
var fileCnt = paths.size
|
||||||
rotatedImagePaths.clear()
|
rotatedImagePaths.clear()
|
||||||
|
activity.toast(R.string.saving)
|
||||||
|
ensureBackgroundThread {
|
||||||
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…
Reference in a new issue