diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-04-11 10:56:09 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-04-11 10:56:09 +0200 |
commit | 7e4827e2537e54b3b337093546d894beccbb5545 (patch) | |
tree | 6c55536abbd5b49b834e3acce044bbcfb8f5de4c /src/de/danoeh/antennapod | |
parent | 0a350c5c9e778dfd72a74d9f0639f3475710d9d3 (diff) | |
parent | 7a33b7f96e2367df2cefa5041016153212b76362 (diff) | |
download | AntennaPod-7e4827e2537e54b3b337093546d894beccbb5545.zip |
Merge branch 'external_itemlist_update' into develop
Diffstat (limited to 'src/de/danoeh/antennapod')
-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() { |