summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/feedlist_item.xml56
-rw-r--r--src/de/danoeh/antennapod/adapter/FeedlistAdapter.java28
2 files changed, 72 insertions, 12 deletions
diff --git a/res/layout/feedlist_item.xml b/res/layout/feedlist_item.xml
index 4677cae84..87f18f64e 100644
--- a/res/layout/feedlist_item.xml
+++ b/res/layout/feedlist_item.xml
@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="4dp"
- android:paddingRight="16dp"
+ android:paddingRight="8dp"
android:paddingTop="4dp" >
<ImageView
@@ -18,19 +18,61 @@
android:cropToPadding="true"
android:scaleType="fitXY" />
- <TextView
- android:id="@+id/txtvNewEps"
+ <LinearLayout
+ android:id="@+id/lEpisodeCounts"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
- android:textSize="20dp"
- android:textStyle="bold" />
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/lNewStatusLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="0dip"
+ android:layout_weight="1" >
+
+ <TextView
+ android:id="@+id/txtvNewEps"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_marginRight="4dip"
+ android:textSize="20dp"
+ android:textStyle="bold" />
+
+ <View
+ android:layout_width="5dip"
+ android:layout_height="match_parent"
+ android:background="@color/status_unread"
+ android:visibility="visible" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/lProgressStatusLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="0dip"
+ android:layout_weight="1" >
+
+ <TextView
+ android:id="@+id/txtvProgressEps"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_marginRight="4dip"
+ android:textSize="20dp"
+ android:textStyle="bold" />
+
+ <View
+ android:layout_width="5dip"
+ android:layout_height="match_parent"
+ android:background="@color/status_progress"
+ android:visibility="visible" />
+ </LinearLayout>
+ </LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
- android:layout_toLeftOf="@id/txtvNewEps"
+ android:layout_toLeftOf="@id/lEpisodeCounts"
android:layout_toRightOf="@id/imgvFeedimage"
android:orientation="vertical" >
diff --git a/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java
index 8e41b2270..be233b554 100644
--- a/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java
@@ -47,6 +47,12 @@ public class FeedlistAdapter extends ArrayAdapter<Feed> {
holder.newEpisodes = (TextView) convertView
.findViewById(R.id.txtvNewEps);
+ holder.inProgressEpisodes = (TextView) convertView
+ .findViewById(R.id.txtvProgressEps);
+ holder.newEpisodesLabel = (View) convertView
+ .findViewById(R.id.lNewStatusLabel);
+ holder.inProgressEpisodesLabel = (View) convertView
+ .findViewById(R.id.lProgressStatusLabel);
holder.image = (ImageView) convertView
.findViewById(R.id.imgvFeedimage);
holder.lastUpdate = (TextView) convertView
@@ -79,16 +85,25 @@ public class FeedlistAdapter extends ArrayAdapter<Feed> {
holder.numberOfEpisodes.setText(feed.getNumOfItems()
+ convertView.getResources()
.getString(R.string.episodes_suffix));
-
+
int newItems = feed.getNumOfNewItems();
- int startedItems = feed.getNumOfStartedItems();
-
+ int inProgressItems = feed.getNumOfStartedItems();
+
if (newItems > 0) {
holder.newEpisodes.setText(Integer.toString(newItems));
- holder.newEpisodes.setVisibility(View.VISIBLE);
+ holder.newEpisodesLabel.setVisibility(View.VISIBLE);
+ } else {
+ holder.newEpisodesLabel.setVisibility(View.INVISIBLE);
+ }
+
+ if (inProgressItems > 0) {
+ holder.inProgressEpisodes
+ .setText(Integer.toString(inProgressItems));
+ holder.inProgressEpisodesLabel.setVisibility(View.VISIBLE);
} else {
- holder.newEpisodes.setVisibility(View.INVISIBLE);
+ holder.inProgressEpisodesLabel.setVisibility(View.INVISIBLE);
}
+
holder.image.setTag(feed.getImage());
imageLoader.loadThumbnailBitmap(
@@ -105,7 +120,10 @@ public class FeedlistAdapter extends ArrayAdapter<Feed> {
TextView lastUpdate;
TextView numberOfEpisodes;
TextView newEpisodes;
+ TextView inProgressEpisodes;
ImageView image;
+ View newEpisodesLabel;
+ View inProgressEpisodesLabel;
}
public int getSelectedItemIndex() {