mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +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())
|
val fileDirItem = FileDirItem(path, path.getFilenameFromPath())
|
||||||
if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
|
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)) {
|
movePathsInRecycleBin(arrayListOf(path)) {
|
||||||
if (it) {
|
if (it) {
|
||||||
handleDeletion(fileDirItem, false)
|
tryDeleteFileDirItem(fileDirItem, false, false) {
|
||||||
|
mIgnoredPaths.remove(fileDirItem.path)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
toast(R.string.unknown_error_occurred)
|
toast(R.string.unknown_error_occurred)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
handleDeletion(fileDirItem, true)
|
handleDeletion(fileDirItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleDeletion(fileDirItem: FileDirItem, deleteFromDatabase: Boolean) {
|
private fun handleDeletion(fileDirItem: FileDirItem) {
|
||||||
mIgnoredPaths.add(fileDirItem.path)
|
mIgnoredPaths.add(fileDirItem.path)
|
||||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
gotMedia(media)
|
gotMedia(media)
|
||||||
}
|
}
|
||||||
tryDeleteFileDirItem(fileDirItem, false, deleteFromDatabase) {
|
|
||||||
|
tryDeleteFileDirItem(fileDirItem, false, true) {
|
||||||
mIgnoredPaths.remove(fileDirItem.path)
|
mIgnoredPaths.remove(fileDirItem.path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue