From 25e4564b1e7a9a63f961215cf6a52caaa83e1022 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 17 Feb 2018 11:35:01 +0100 Subject: [PATCH] refresh items only if they changed --- .../filemanager/adapters/ItemsAdapter.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 07164dd3..05ad240e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -42,6 +42,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList) { - fileDirItems = newItems - notifyDataSetChanged() - finishActMode() + if (newItems.hashCode() != currentItemsHash) { + currentItemsHash = newItems.hashCode() + fileDirItems = newItems + notifyDataSetChanged() + finishActMode() + } } override fun onViewRecycled(holder: ViewHolder?) {