From 2ea470f7e8ea93ab3ee960fdd944aefe4aa492f0 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 12 Dec 2012 18:28:10 +0000 Subject: [PATCH] --- res/layout/rowlayout.xml | 35 +++++++++++++++++++++++++---------- src/com/upc/pbe/upcnews/ResourceAdapter.java | 10 ++++++++-- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/res/layout/rowlayout.xml b/res/layout/rowlayout.xml index 324a9d5..e390b54 100644 --- a/res/layout/rowlayout.xml +++ b/res/layout/rowlayout.xml @@ -1,10 +1,25 @@ - - - \ No newline at end of file + + + + + + + + \ No newline at end of file diff --git a/src/com/upc/pbe/upcnews/ResourceAdapter.java b/src/com/upc/pbe/upcnews/ResourceAdapter.java index 7e0adab..b108ced 100644 --- a/src/com/upc/pbe/upcnews/ResourceAdapter.java +++ b/src/com/upc/pbe/upcnews/ResourceAdapter.java @@ -8,6 +8,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; +import android.widget.ImageView; import android.widget.TextView; //Modificacio de l'Adapter d'Adnroid, creat al nostre gust per donar estil als elements de la ListView de directoris i arxius @@ -27,24 +28,29 @@ public class ResourceAdapter extends ArrayAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { TextView row; + ImageView rowImage; if (convertView == null) { LayoutInflater inflater = ((Activity)context).getLayoutInflater(); row = (TextView) inflater.inflate(R.layout.rowlayout, parent, false); + rowImage = (ImageView) inflater.inflate(R.layout.rowlayout, parent, false); } else { row = (TextView) convertView; + rowImage = (ImageView) convertView; } final String text = entries[position]; row.setText(text); - //Si es un m3u8, posem el text en verd + //Si es un m3u8, posem el text en verd i l'icono de video if(text.endsWith(".m3u8")) { row.setTextColor(Color.parseColor("#5FB404")); + rowImage.setImageResource(R.drawable.mediacontroller_ff_left); } - //Si no, posem el text en blau + //Si no, posem el text en blau i l'icono de directori else{ row.setTypeface(null,Typeface.NORMAL); row.setTextColor(((Activity)context).getResources().getColor(R.color.BlueAndroid)); + rowImage.setImageResource(R.drawable.mediacontroller_ff_right); } return row; } -- libgit2 0.22.2