From bef547418273cde61a2b2451b4904c2b433b2c8d Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 30 Mar 2018 21:36:57 +0200 Subject: [PATCH] create clones of arraylists at updating thumbnails --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 2 +- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 20e7802d7..2db143623 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -317,7 +317,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList) { if (newDirs.hashCode() != currentDirectoriesHash) { currentDirectoriesHash = newDirs.hashCode() - dirs = newDirs + dirs = newDirs.clone() as ArrayList notifyDataSetChanged() finishActMode() } 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 2fa48aca4..1b0dfd8c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -256,7 +256,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, fun updateMedia(newMedia: ArrayList) { if (newMedia.hashCode() != currentMediaHash) { currentMediaHash = newMedia.hashCode() - media = newMedia + media = newMedia.clone() as ArrayList enableInstantLoad() notifyDataSetChanged() finishActMode()