make sure we are updating media from the ui htread

This commit is contained in:
tibbi 2019-05-15 09:01:39 +02:00
parent 37610e8980
commit b21305cb4b

View file

@ -924,7 +924,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun handleDeletion(fileDirItem: FileDirItem, deleteFromDatabase: Boolean) { private fun handleDeletion(fileDirItem: FileDirItem, deleteFromDatabase: Boolean) {
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 {
gotMedia(media) gotMedia(media)
}
tryDeleteFileDirItem(fileDirItem, false, deleteFromDatabase) { tryDeleteFileDirItem(fileDirItem, false, deleteFromDatabase) {
mIgnoredPaths.remove(fileDirItem.path) mIgnoredPaths.remove(fileDirItem.path)
} }