diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-06-08 13:57:32 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-06-08 13:57:32 +0200 |
commit | d9a610fb61028845349d98c4e1574778a7cfc05e (patch) | |
tree | 0103ceec7eef54c940ad80d12f90c5c975dda602 /src/de/danoeh/antennapod/adapter | |
parent | c3e0ac9e74ef012c08eef0348604c2fdefca8074 (diff) | |
download | AntennaPod-d9a610fb61028845349d98c4e1574778a7cfc05e.zip |
Show queue size and number of unread items in navdrawer. closes #453
Diffstat (limited to 'src/de/danoeh/antennapod/adapter')
-rw-r--r-- | src/de/danoeh/antennapod/adapter/NavListAdapter.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/adapter/NavListAdapter.java b/src/de/danoeh/antennapod/adapter/NavListAdapter.java index 928ec5dde..2e95a176b 100644 --- a/src/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -113,6 +113,7 @@ public class NavListAdapter extends BaseAdapter { convertView = inflater.inflate(R.layout.nav_listitem, null); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); + holder.count = (TextView) convertView.findViewById(R.id.txtvCount); holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); convertView.setTag(holder); } else { @@ -120,6 +121,17 @@ public class NavListAdapter extends BaseAdapter { } holder.title.setText(title); + + if (NAV_TITLES[position] == R.string.queue_label) { + holder.count.setVisibility(View.VISIBLE); + holder.count.setText(String.valueOf(itemAccess.getQueueSize())); + } else if (NAV_TITLES[position] == R.string.all_episodes_label) { + holder.count.setVisibility(View.VISIBLE); + holder.count.setText(String.valueOf(itemAccess.getNumberOfUnreadItems())); + } else { + holder.count.setVisibility(View.GONE); + } + holder.image.setImageDrawable(drawables[position]); return convertView; @@ -174,6 +186,7 @@ public class NavListAdapter extends BaseAdapter { static class NavHolder { TextView title; + TextView count; ImageView image; } @@ -193,6 +206,10 @@ public class NavListAdapter extends BaseAdapter { public Feed getItem(int position); public int getSelectedItemIndex(); + + public int getQueueSize(); + + public int getNumberOfUnreadItems(); } } |