diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index b5c043d9c..6e0c190e6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -235,6 +235,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, media.removeAll(removeMedia) listener?.deleteFiles(fileDirItems) removeSelectedItems() + updateStoredFolderItems() } } @@ -244,6 +245,14 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, return selectedMedia } + private fun updateStoredFolderItems() { + Thread { + if (media.isNotEmpty()) { + activity.applicationContext.storeFolderItems(media.first().path.getParentPath(), media as ArrayList) + } + }.start() + } + fun updateMedia(newMedia: ArrayList) { if (newMedia.hashCode() != currentMediaHash) { currentMediaHash = newMedia.hashCode()