Added 'Playing' state

This commit is contained in:
daniel oeh 2012-11-16 19:36:21 +01:00
parent a7831abf77
commit 385b11eae2
3 changed files with 19 additions and 5 deletions

View File

@ -25,5 +25,6 @@
<color name="download_failed_red">#CC0000</color>
<color name="status_unread">#99CC00</color>
<color name="status_progress">#FFBB33</color>
<color name="status_playing">#EE5F52</color>
</resources>

View File

@ -93,13 +93,21 @@ public class FeedItemlistAdapter extends ArrayAdapter<FeedItem> {
holder.feedtitle.setText(item.getFeed().getTitle());
}
if (item.isInProgress()) {
if (item.isPlaying()) {
holder.title.setTypeface(Typeface.DEFAULT_BOLD);
holder.statusLabel.setBackgroundColor(convertView.getResources().getColor(R.color.status_progress));
holder.statusLabel.setBackgroundColor(convertView
.getResources().getColor(R.color.status_playing));
holder.statusLabel.setVisibility(View.VISIBLE);
} else if (item.isInProgress()) {
holder.title.setTypeface(Typeface.DEFAULT_BOLD);
holder.statusLabel.setBackgroundColor(convertView
.getResources().getColor(R.color.status_progress));
holder.statusLabel.setVisibility(View.VISIBLE);
} else if (!item.isRead()) {
holder.title.setTypeface(Typeface.DEFAULT_BOLD);
holder.statusLabel.setBackgroundColor(convertView.getResources().getColor(R.color.status_unread));
holder.statusLabel.setBackgroundColor(convertView
.getResources().getColor(R.color.status_unread));
holder.statusLabel.setVisibility(View.VISIBLE);
} else {
holder.title.setTypeface(Typeface.DEFAULT);

View File

@ -50,8 +50,13 @@ public class FeedItemMenuHandler {
selectedItem.getLink() != null);
menu.findItem(R.id.mark_unread_item).setVisible(
selectedItem.isRead() || selectedItem.isInProgress());
menu.findItem(R.id.mark_read_item).setVisible(!selectedItem.isRead() || selectedItem.isInProgress());
!selectedItem.isPlaying()
&& (selectedItem.isRead() || selectedItem
.isInProgress()));
menu.findItem(R.id.mark_read_item).setVisible(
!selectedItem.isPlaying()
&& (!selectedItem.isRead() || selectedItem
.isInProgress()));
if (selectedItem.getLink() != null) {
menu.findItem(R.id.visit_website_item).setVisible(true);