mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
delete images on a background thread from viewpager too
This commit is contained in:
parent
58ace8e59f
commit
0e541f091c
1 changed files with 8 additions and 3 deletions
|
@ -241,11 +241,16 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
// double check we have the uri to the proper file path, not some parent folder
|
// double check we have the uri to the proper file path, not some parent folder
|
||||||
val uri = URLDecoder.decode(document.uri.toString(), "UTF-8")
|
val uri = URLDecoder.decode(document.uri.toString(), "UTF-8")
|
||||||
if (uri.endsWith(file.absolutePath.getFilenameFromPath()) && !document.isDirectory)
|
if (uri.endsWith(file.absolutePath.getFilenameFromPath()) && !document.isDirectory) {
|
||||||
|
Thread({
|
||||||
document.delete()
|
document.delete()
|
||||||
|
}).start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Thread({
|
||||||
file.delete()
|
file.delete()
|
||||||
|
}).start()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deleteFromMediaStore(file)) {
|
if (deleteFromMediaStore(file)) {
|
||||||
|
|
Loading…
Reference in a new issue