[Android] TV: use Categories icons

Geoffrey Métais git at videolan.org
Wed Dec 3 18:03:06 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec  3 18:02:52 2014 +0100| [0f1698ac1b62b6087746e628ddc24e5f45985d2e] | committer: Jean-Baptiste Kempf

TV: use Categories icons

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0f1698ac1b62b6087746e628ddc24e5f45985d2e
---

 .../src/org/videolan/vlc/gui/tv/CardPresenter.java |   21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/CardPresenter.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/CardPresenter.java
index 874953c..f449141 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/CardPresenter.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/CardPresenter.java
@@ -99,6 +99,9 @@ public class CardPresenter extends Presenter {
             holder.mCardView.setContentText(media.getDescription());
 	        if (media.isPictureParsed())
                 holder.updateCardViewImage(media.getLocation());
+            else if (media.getType() == Media.TYPE_GROUP)
+                holder.updateCardViewImage(holder.view.getContext().getResources().getDrawable(
+                        R.drawable.ic_video_collection_big));
 			else
                 holder.updateCardViewImage(sDefaultCardImage);
     	} else if (item instanceof GridFragment.ListItem) {
@@ -111,13 +114,25 @@ public class CardPresenter extends Presenter {
 			else
                 holder.updateCardViewImage(sDefaultCardImage);
     	} else if (item instanceof String){
-            Resources res = viewHolder.view.getContext().getResources();
+            Resources res = holder.view.getContext().getResources();
             holder.mCardView.setTitleText((String) item);
             if (res.getString(R.string.preferences).equals(item.toString()))
                 holder.updateCardViewImage(res.getDrawable(
                         R.drawable.ic_menu_preferences_big));
-                else
-                holder.updateCardViewImage(sDefaultCardImage);
+            else if (res.getString(R.string.artists).equals(item.toString()))
+                holder.updateCardViewImage(res.getDrawable(
+                        R.drawable.ic_artist_big));
+            else if (res.getString(R.string.albums).equals(item.toString()))
+                holder.updateCardViewImage(res.getDrawable(
+                        R.drawable.ic_album_big));
+            else if (res.getString(R.string.genres).equals(item.toString()))
+                holder.updateCardViewImage(res.getDrawable(
+                        R.drawable.ic_genre_big));
+            else if (res.getString(R.string.songs).equals(item.toString()))
+                holder.updateCardViewImage(res.getDrawable(
+                        R.drawable.ic_song_big));
+            else
+            holder.updateCardViewImage(sDefaultCardImage);
     	}
     }
 



More information about the Android mailing list