[Android] Fix default cover in Search results

Geoffrey Métais git at videolan.org
Tue Jan 31 16:30:11 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 31 16:26:55 2017 +0100| [91c3c3165290806f81a64b3e05820e2ba2923ccf] | committer: Geoffrey Métais

Fix default cover in Search results

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

 vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java b/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java
index c66aa0b..5d4b672 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java
@@ -2,11 +2,13 @@ package org.videolan.vlc.gui;
 
 import android.content.Context;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.ViewGroup;
 
 import org.videolan.medialibrary.media.MediaLibraryItem;
 import org.videolan.vlc.databinding.SearchItemBinding;
+import org.videolan.vlc.gui.helpers.UiTools;
 
 
 public class SearchResultAdapter extends RecyclerView.Adapter<SearchResultAdapter.ViewHolder> {
@@ -22,6 +24,8 @@ public class SearchResultAdapter extends RecyclerView.Adapter<SearchResultAdapte
 
     @Override
     public void onBindViewHolder(ViewHolder holder, int position) {
+        if (TextUtils.isEmpty(mDataList[position].getArtworkMrl()))
+            holder.binding.setCover(UiTools.getDefaultCover(mDataList[position]));
         holder.binding.setItem(mDataList[position]);
     }
 



More information about the Android mailing list