mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +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
|
||||
val uri = URLDecoder.decode(document.uri.toString(), "UTF-8")
|
||||
if (uri.endsWith(file.absolutePath.getFilenameFromPath()) && !document.isDirectory)
|
||||
document.delete()
|
||||
if (uri.endsWith(file.absolutePath.getFilenameFromPath()) && !document.isDirectory) {
|
||||
Thread({
|
||||
document.delete()
|
||||
}).start()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
file.delete()
|
||||
Thread({
|
||||
file.delete()
|
||||
}).start()
|
||||
}
|
||||
|
||||
if (deleteFromMediaStore(file)) {
|
||||
|
|
Loading…
Reference in a new issue