mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
use a background thread for deleting stuff
This commit is contained in:
parent
b6fbe68643
commit
de63b61bf6
2 changed files with 9 additions and 3 deletions
|
@ -160,7 +160,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
private fun askConfirmDelete() {
|
private fun askConfirmDelete() {
|
||||||
ConfirmationDialog(this) {
|
ConfirmationDialog(this) {
|
||||||
deleteFile()
|
Thread({
|
||||||
|
deleteFile()
|
||||||
|
}).start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
private fun askConfirmDelete() {
|
private fun askConfirmDelete() {
|
||||||
ConfirmationDialog(activity) {
|
ConfirmationDialog(activity) {
|
||||||
actMode?.finish()
|
actMode?.finish()
|
||||||
deleteFiles()
|
Thread({
|
||||||
|
deleteFiles()
|
||||||
|
}).start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +189,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
val medium = media[it]
|
val medium = media[it]
|
||||||
files.add(File(medium.path))
|
files.add(File(medium.path))
|
||||||
removeMedia.add(medium)
|
removeMedia.add(medium)
|
||||||
notifyItemRemoved(it)
|
activity.runOnUiThread {
|
||||||
|
notifyItemRemoved(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
media.removeAll(removeMedia)
|
media.removeAll(removeMedia)
|
||||||
|
|
Loading…
Reference in a new issue