diff options
Diffstat (limited to 'src/de/danoeh')
-rw-r--r-- | src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java index 9989fb283..916e13469 100644 --- a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java @@ -231,20 +231,26 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter { TextView headerTitle = (TextView) convertView .findViewById(R.id.txtvHeaderTitle); ImageButton actionButton = (ImageButton) convertView - .findViewById(R.id.butAction); + .findViewById(R.id.butAction); + TextView numItems = (TextView) convertView.findViewById(R.id.txtvNumItems); + String headerString = null; + int childrenCount = 0; + if (groupPosition == 0) { headerString = context.getString(R.string.queue_label); - if (manager.getQueueSize(true) > 0) { - headerString += " (" + getChildrenCount(GROUP_POS_QUEUE) + ")"; - } + childrenCount = getChildrenCount(GROUP_POS_QUEUE); } else { headerString = context.getString(R.string.waiting_list_label); - if (manager.getUnreadItemsSize(true) > 0) { - headerString += " (" + getChildrenCount(GROUP_POS_UNREAD) + ")"; - } + childrenCount = getChildrenCount(GROUP_POS_UNREAD); } headerTitle.setText(headerString); + if (childrenCount <= 0) { + numItems.setVisibility(View.INVISIBLE); + } else { + numItems.setVisibility(View.VISIBLE); + numItems.setText(Integer.toString(childrenCount)); + } actionButton.setFocusable(false); actionButton.setOnClickListener(new OnClickListener() { |