From 235c07393857cd8f87f1f09b43248caf96bb328e Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Tue, 12 Feb 2013 00:56:51 +0100 Subject: [PATCH] Improved status indicators of feeditemlist items --- res/layout/feeditemlist_item.xml | 247 ++++++++++-------- res/values/colors.xml | 2 +- .../adapter/FeedItemlistAdapter.java | 40 +-- 3 files changed, 166 insertions(+), 123 deletions(-) diff --git a/res/layout/feeditemlist_item.xml b/res/layout/feeditemlist_item.xml index 1b9ebaaab..2cc7ee703 100644 --- a/res/layout/feeditemlist_item.xml +++ b/res/layout/feeditemlist_item.xml @@ -1,114 +1,151 @@ - - + + + + + + + + + + + + + + + + + + + android:gravity="center" + android:minWidth="@dimen/status_indicator_width" + android:text="@string/new_label" + android:textAlignment="center" + android:textColor="@color/white" + android:textSize="@dimen/text_size_micro" + android:textStyle="bold" /> - + - + - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index 98aebe3b3..5cf84ec4a 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -25,7 +25,7 @@ #CC0000 #E099CC00 #E033B5E5 - #EE5F52 + #E0EE5F52 #262C31 #DDDDDD diff --git a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index 3ca63e97f..5941d52ea 100644 --- a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -68,8 +68,12 @@ public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter { holder.feedtitle = (TextView) convertView .findViewById(R.id.txtvFeedname); } - holder.statusLabel = (View) convertView - .findViewById(R.id.vStatusLabel); + holder.statusPlaying = (View) convertView + .findViewById(R.id.statusPlaying); + holder.statusUnread = (View) convertView + .findViewById(R.id.statusUnread); + holder.statusInProgress = (TextView) convertView + .findViewById(R.id.statusInProgress); convertView.setTag(holder); } else { @@ -93,26 +97,26 @@ public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter { FeedItem.State state = item.getState(); switch (state) { case PLAYING: - holder.title.setTypeface(Typeface.DEFAULT_BOLD); - holder.statusLabel.setBackgroundColor(convertView - .getResources().getColor(R.color.status_playing)); - holder.statusLabel.setVisibility(View.VISIBLE); + holder.statusPlaying.setVisibility(View.VISIBLE); + holder.statusUnread.setVisibility(View.GONE); + holder.statusInProgress.setVisibility(View.GONE); break; case IN_PROGRESS: - holder.title.setTypeface(Typeface.DEFAULT_BOLD); - holder.statusLabel.setBackgroundColor(convertView - .getResources().getColor(R.color.status_progress)); - holder.statusLabel.setVisibility(View.VISIBLE); + holder.statusPlaying.setVisibility(View.GONE); + holder.statusUnread.setVisibility(View.GONE); + holder.statusInProgress.setVisibility(View.VISIBLE); + holder.statusInProgress.setText(Converter + .getDurationStringLong(item.getMedia().getPosition())); break; case NEW: - holder.title.setTypeface(Typeface.DEFAULT_BOLD); - holder.statusLabel.setBackgroundColor(convertView - .getResources().getColor(R.color.status_unread)); - holder.statusLabel.setVisibility(View.VISIBLE); + holder.statusPlaying.setVisibility(View.GONE); + holder.statusUnread.setVisibility(View.VISIBLE); + holder.statusInProgress.setVisibility(View.GONE); break; default: - holder.title.setTypeface(Typeface.DEFAULT); - holder.statusLabel.setVisibility(View.INVISIBLE); + holder.statusPlaying.setVisibility(View.GONE); + holder.statusUnread.setVisibility(View.GONE); + holder.statusInProgress.setVisibility(View.GONE); break; } @@ -198,7 +202,9 @@ public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter { ImageView type; ImageView downloading; ImageButton butAction; - View statusLabel; + View statusUnread; + View statusPlaying; + TextView statusInProgress; } public int getSelectedItemIndex() {