mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-04-02 20:51:19 +02:00
update UI at picker dialogs from the main thread
This commit is contained in:
parent
37c31f813b
commit
b0a26d0bd8
@ -42,9 +42,11 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
|
|||||||
|
|
||||||
activity.getCachedDirectories {
|
activity.getCachedDirectories {
|
||||||
if (it.isNotEmpty()) {
|
if (it.isNotEmpty()) {
|
||||||
|
activity.runOnUiThread {
|
||||||
gotDirectories(activity.addTempFolderIfNeeded(it))
|
gotDirectories(activity.addTempFolderIfNeeded(it))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GetDirectoriesAsynctask(activity, false, false) {
|
GetDirectoriesAsynctask(activity, false, false) {
|
||||||
gotDirectories(activity.addTempFolderIfNeeded(it))
|
gotDirectories(activity.addTempFolderIfNeeded(it))
|
||||||
|
@ -39,9 +39,11 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
|
|||||||
activity.getCachedMedia(path) {
|
activity.getCachedMedia(path) {
|
||||||
val media = it.filter { !it.isVideo() } as ArrayList
|
val media = it.filter { !it.isVideo() } as ArrayList
|
||||||
if (media.isNotEmpty()) {
|
if (media.isNotEmpty()) {
|
||||||
|
activity.runOnUiThread {
|
||||||
gotMedia(media)
|
gotMedia(media)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GetMediaAsynctask(activity, path, false, true, false) {
|
GetMediaAsynctask(activity, path, false, true, false) {
|
||||||
gotMedia(it)
|
gotMedia(it)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user