summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/adapter
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2013-04-09 12:47:39 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2013-04-10 11:46:17 +0200
commit1ab5a0942981a0572fa2222ecbc7f5f94f662721 (patch)
treedd24efc47b04938f776797865e91c1edba5e3071 /src/de/danoeh/antennapod/adapter
parenta6d68205a5e511097496a8c2c5f2600f99677d94 (diff)
downloadAntennaPod-1ab5a0942981a0572fa2222ecbc7f5f94f662721.zip
Updated header view layout
Diffstat (limited to 'src/de/danoeh/antennapod/adapter')
-rw-r--r--src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java20
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 cde21895f..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() {