[Android] Video groups: set default icon on view recycling

Geoffrey Métais git at videolan.org
Wed Sep 25 16:28:57 CEST 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Sep 25 16:25:29 2019 +0200| [ca8cc43a7a1fd3440318f1d15fca940b5d5fdcea] | committer: Geoffrey Métais

Video groups: set default icon on view recycling

(cherry picked from commit 42082e7b2e011e81c6b0f414541cf6dd35f2e29a)

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

 .../src/org/videolan/vlc/gui/videogroups/VideoGroupsAdapter.kt      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/videogroups/VideoGroupsAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/videogroups/VideoGroupsAdapter.kt
index 7692462c4..ec3dc30b6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/videogroups/VideoGroupsAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/videogroups/VideoGroupsAdapter.kt
@@ -14,9 +14,11 @@ import org.videolan.libvlc.util.AndroidUtil
 import org.videolan.medialibrary.interfaces.media.AbstractVideoGroup
 import org.videolan.tools.MultiSelectAdapter
 import org.videolan.tools.MultiSelectHelper
+import org.videolan.vlc.BR
 import org.videolan.vlc.R
 import org.videolan.vlc.databinding.VideogroupItemBinding
 import org.videolan.vlc.gui.helpers.SelectorViewHolder
+import org.videolan.vlc.gui.helpers.UiTools
 import org.videolan.vlc.util.UPDATE_SELECTION
 
 
@@ -53,6 +55,10 @@ class VideoGroupsAdapter (val actor: SendChannel<VideoGroupAction>) : PagedListA
         }
     }
 
+    override fun onViewRecycled(holder: ViewHolder) {
+        holder.binding.setVariable(BR.cover, UiTools.getDefaultVideoDrawable(holder.itemView.context))
+    }
+
     @TargetApi(Build.VERSION_CODES.M)
     inner class ViewHolder(binding: VideogroupItemBinding) : SelectorViewHolder<VideogroupItemBinding>(binding) {
         init {



More information about the Android mailing list