From 1cd840077e0cbf3491f5c8c4a15ff5ae11a71797 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Nov 2011 14:25:55 +0300 Subject: [PATCH] add generic feed icons to feedlist --- res/layout/feeds_row.xml | 13 +++++++++++-- res/layout/feeds_row_selected.xml | 13 +++++++++++-- src/org/fox/ttrss/FeedsFragment.java | 9 ++++++++- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/res/layout/feeds_row.xml b/res/layout/feeds_row.xml index 8ef8bbac..88704a1f 100644 --- a/res/layout/feeds_row.xml +++ b/res/layout/feeds_row.xml @@ -4,13 +4,21 @@ android:orientation="horizontal" android:gravity="center_vertical" android:id="@+id/feeds_row" android:layout_width="match_parent" android:paddingBottom="4dip" android:paddingLeft="8dip" android:paddingRight="8dip" android:paddingTop="4dip"> + + + + android:text="{FEED}" android:layout_width="0dp" android:textSize="18dip"/> + android:text="{123}" android:textSize="13sp"/> \ No newline at end of file diff --git a/res/layout/feeds_row_selected.xml b/res/layout/feeds_row_selected.xml index a694119b..bab97849 100644 --- a/res/layout/feeds_row_selected.xml +++ b/res/layout/feeds_row_selected.xml @@ -5,13 +5,21 @@ android:background="?feedsSelectedBackground" android:gravity="center_vertical" android:id="@+id/feeds_row" android:layout_width="match_parent" android:paddingBottom="4dip" android:paddingLeft="8dip" android:paddingRight="8dip" android:paddingTop="4dip"> + + + + android:text="{FEED}" android:layout_width="0dp" android:textSize="18dip"/> + android:text="{123}" android:textSize="13sp"/> \ No newline at end of file diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index de277e76..0b8d7696 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -19,6 +19,7 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -285,7 +286,13 @@ public class FeedsFragment extends Fragment implements OnItemClickListener { if (tu != null) { tu.setText(String.valueOf(feed.unread)); tu.setVisibility((feed.unread > 0) ? View.VISIBLE : View.INVISIBLE); - } + } + + ImageView icon = (ImageView)v.findViewById(R.id.icon); + + if (icon != null) { + icon.setImageResource(feed.unread > 0 ? R.drawable.ic_rss : R.drawable.ic_rss_bw); + } return v; }