update stored folder items after deleting
This commit is contained in:
parent
7ebc110ac8
commit
0552c12d17
1 changed files with 9 additions and 0 deletions
|
@ -235,6 +235,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
|
|||
media.removeAll(removeMedia)
|
||||
listener?.deleteFiles(fileDirItems)
|
||||
removeSelectedItems()
|
||||
updateStoredFolderItems()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,6 +245,14 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
|
|||
return selectedMedia
|
||||
}
|
||||
|
||||
private fun updateStoredFolderItems() {
|
||||
Thread {
|
||||
if (media.isNotEmpty()) {
|
||||
activity.applicationContext.storeFolderItems(media.first().path.getParentPath(), media as ArrayList<Medium>)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
fun updateMedia(newMedia: ArrayList<Medium>) {
|
||||
if (newMedia.hashCode() != currentMediaHash) {
|
||||
currentMediaHash = newMedia.hashCode()
|
||||
|
|
Loading…
Reference in a new issue