diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-04-09 12:47:39 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-04-10 11:46:17 +0200 |
commit | 1ab5a0942981a0572fa2222ecbc7f5f94f662721 (patch) | |
tree | dd24efc47b04938f776797865e91c1edba5e3071 /src/de/danoeh/antennapod | |
parent | a6d68205a5e511097496a8c2c5f2600f99677d94 (diff) | |
download | AntennaPod-1ab5a0942981a0572fa2222ecbc7f5f94f662721.zip |
Updated header view layout
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 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() { |