mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
speed up video moving in the recycle bin from fullscreen view
This commit is contained in:
parent
e7e1c561d8
commit
7e73d979a1
1 changed files with 13 additions and 4 deletions
|
@ -909,25 +909,34 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
val fileDirItem = FileDirItem(path, path.getFilenameFromPath())
|
||||
if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
|
||||
mIgnoredPaths.add(fileDirItem.path)
|
||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||
runOnUiThread {
|
||||
gotMedia(media)
|
||||
}
|
||||
|
||||
movePathsInRecycleBin(arrayListOf(path)) {
|
||||
if (it) {
|
||||
handleDeletion(fileDirItem, false)
|
||||
tryDeleteFileDirItem(fileDirItem, false, false) {
|
||||
mIgnoredPaths.remove(fileDirItem.path)
|
||||
}
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
handleDeletion(fileDirItem, true)
|
||||
handleDeletion(fileDirItem)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleDeletion(fileDirItem: FileDirItem, deleteFromDatabase: Boolean) {
|
||||
private fun handleDeletion(fileDirItem: FileDirItem) {
|
||||
mIgnoredPaths.add(fileDirItem.path)
|
||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||
runOnUiThread {
|
||||
gotMedia(media)
|
||||
}
|
||||
tryDeleteFileDirItem(fileDirItem, false, deleteFromDatabase) {
|
||||
|
||||
tryDeleteFileDirItem(fileDirItem, false, true) {
|
||||
mIgnoredPaths.remove(fileDirItem.path)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue