[Android] Videos: Clear list views

Geoffrey Métais git at videolan.org
Tue Oct 8 16:39:26 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct  8 16:38:31 2019 +0200| [19792df74871da688cdcbef02294326d0c1ad0be] | committer: Geoffrey Métais

Videos: Clear list views

Some elements could persist when switching from a grouping option to
another

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
index dc7128b79..2252b9a8b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
@@ -154,11 +154,17 @@ class VideoListAdapter internal constructor(
                 val count = withContext(Dispatchers.IO) { item.mediaCount(AbstractFolder.TYPE_FOLDER_VIDEO) }
                 holder.binding.setVariable(BR.time, holder.itemView.context.resources.getQuantityString(R.plurals.videos_quantity, count, count))
                 holder.title.text = item.title
+                if (!isListMode) holder.binding.setVariable(BR.resolution, null)
+                holder.binding.setVariable(BR.seen, 0L)
+                holder.binding.setVariable(BR.max, 0)
             }
             is AbstractVideoGroup -> launch {
                 val count = item.mediaCount()
                 holder.binding.setVariable(BR.time, if (count < 2) null else holder.itemView.context.resources.getQuantityString(R.plurals.videos_quantity, count, count))
                 holder.title.text = item.title
+                if (!isListMode) holder.binding.setVariable(BR.resolution, null)
+                holder.binding.setVariable(BR.seen, 0L)
+                holder.binding.setVariable(BR.max, 0)
             }
             is AbstractMediaWrapper -> {
                 holder.title.text = if (showFilename.get()) item.fileName else item.title



More information about the Android mailing list