mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-10 09:00:48 +01:00
Do processing on background thread
This commit is contained in:
parent
ce898ba1cc
commit
726e7c1649
@ -774,6 +774,7 @@ fun BaseSimpleActivity.ensureWriteAccess(path: String, callback: () -> Unit) {
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.N)
|
||||
fun BaseSimpleActivity.launchResizeMultipleImagesDialog(paths: List<String>, callback: (() -> Unit)? = null) {
|
||||
ensureBackgroundThread {
|
||||
val imagePaths = mutableListOf<String>()
|
||||
val imageSizes = mutableListOf<Point>()
|
||||
for (path in paths) {
|
||||
@ -784,9 +785,12 @@ fun BaseSimpleActivity.launchResizeMultipleImagesDialog(paths: List<String>, cal
|
||||
}
|
||||
}
|
||||
|
||||
runOnUiThread {
|
||||
ResizeMultipleImagesDialog(this, imagePaths, imageSizes) {
|
||||
callback?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.N)
|
||||
|
Loading…
x
Reference in New Issue
Block a user