mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
Moved handleRotate to the separate method
This commit is contained in:
parent
57020626db
commit
1f47af7826
1 changed files with 17 additions and 16 deletions
|
@ -307,11 +307,9 @@ class MediaAdapter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun rotateSelection(degrees: Int) {
|
private fun handleRotate(paths: List<String>, degrees: Int) {
|
||||||
val paths = getSelectedPaths().filter { it.isImageFast() }
|
|
||||||
var fileCnt = paths.size
|
var fileCnt = paths.size
|
||||||
rotatedImagePaths.clear()
|
rotatedImagePaths.clear()
|
||||||
val handleRotate = {
|
|
||||||
activity.toast(R.string.saving)
|
activity.toast(R.string.saving)
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
paths.forEach {
|
paths.forEach {
|
||||||
|
@ -329,14 +327,17 @@ class MediaAdapter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun rotateSelection(degrees: Int) {
|
||||||
|
val paths = getSelectedPaths().filter { it.isImageFast() }
|
||||||
|
|
||||||
if (paths.any { activity.needsStupidWritePermissions(it) }) {
|
if (paths.any { activity.needsStupidWritePermissions(it) }) {
|
||||||
activity.handleSAFDialog(paths.first { activity.needsStupidWritePermissions(it) }) {
|
activity.handleSAFDialog(paths.first { activity.needsStupidWritePermissions(it) }) {
|
||||||
if (it) {
|
if (it) {
|
||||||
handleRotate()
|
handleRotate(paths, degrees)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
handleRotate()
|
handleRotate(paths, degrees)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue