[Android] Fix the history adapter item refresh wwhen description changes

Nicolas Pomepuy git at videolan.org
Thu Jul 7 12:12:43 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jul  7 08:44:19 2022 +0200| [b960b146ce82becdf06f859966c890ed4c8034de] | committer: Nicolas Pomepuy

Fix the history adapter item refresh wwhen description changes

Fixes #2592

> https://code.videolan.org/videolan/vlc-android/commit/b960b146ce82becdf06f859966c890ed4c8034de
---

 application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
index 691bacbf4..248f78687 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
@@ -165,4 +165,10 @@ class HistoryAdapter(private val inCards: Boolean = false, private val listEvent
     }
 
     override fun onItemMoved(dragFrom: Int, dragTo: Int) {    }
+
+    override fun createCB(): DiffCallback<MediaWrapper> = object : DiffCallback<MediaWrapper>() {
+        override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) =
+                oldList[oldItemPosition].title == newList[newItemPosition].title &&
+                        oldList[oldItemPosition].description == newList[newItemPosition].description
+    }
 }
\ No newline at end of file



More information about the Android mailing list