mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
fix #1785, properly handle deleting playing videos
This commit is contained in:
parent
f31d9bafa5
commit
2262829077
1 changed files with 8 additions and 4 deletions
|
@ -1033,7 +1033,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
mIgnoredPaths.add(fileDirItem.path)
|
||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||
runOnUiThread {
|
||||
gotMedia(media)
|
||||
gotMedia(media, true)
|
||||
}
|
||||
|
||||
movePathsInRecycleBin(arrayListOf(path)) {
|
||||
|
@ -1055,7 +1055,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
mIgnoredPaths.add(fileDirItem.path)
|
||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||
runOnUiThread {
|
||||
gotMedia(media)
|
||||
gotMedia(media, true)
|
||||
}
|
||||
|
||||
tryDeleteFileDirItem(fileDirItem, false, true) {
|
||||
|
@ -1102,9 +1102,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
}
|
||||
|
||||
private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>) {
|
||||
private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>, ignorePlayingVideos: Boolean = false) {
|
||||
val media = thumbnailItems.asSequence().filter { it is Medium && !mIgnoredPaths.contains(it.path) }.map { it as Medium }.toMutableList() as ArrayList<Medium>
|
||||
if (isDirEmpty(media) || media.hashCode() == mPrevHashcode || (getCurrentFragment() as? VideoFragment)?.mIsPlaying == true) {
|
||||
if (isDirEmpty(media) || media.hashCode() == mPrevHashcode) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!ignorePlayingVideos && (getCurrentFragment() as? VideoFragment)?.mIsPlaying == true) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue