From 97ea54b5cf3743198910a158ff820abd3002edbd Mon Sep 17 00:00:00 2001 From: lado Date: Tue, 15 Nov 2011 09:54:09 +0100 Subject: each channel gets not a group --- vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java | 9 +++++++++ vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java | 6 ++++-- .../src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java | 8 ++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'vdrmanager/src/de') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java index 15f8552..e67e93b 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Channel.java @@ -14,6 +14,15 @@ public class Channel implements Parcelable { private String name; private String provider; private String rawAudio; + private String group; + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } public String getRawAudio() { return rawAudio; diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java index 69d31fd..008e249 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java @@ -100,10 +100,12 @@ class ChannelAdapter extends BaseExpandableListAdapter implements Filterable// , } itemHolder.name.setText(name); - if (groupBy != ChannelListActivity.MENU_PROVIDER) { + if (groupBy == ChannelListActivity.MENU_PROVIDER) { + itemHolder.aux.setText(item.getGroup()); + } else if(groupBy == ChannelListActivity.MENU_GROUP) { itemHolder.aux.setText(item.getProvider()); } else { - itemHolder.aux.setText(""); + itemHolder.aux.setText(item.getProvider()); } return view; diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java index 6f394de..e367bd6 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/ChannelClient.java @@ -101,10 +101,12 @@ public class ChannelClient extends SvdrpClient implements } ArrayList currentChannels = new ArrayList(); - + String currentGroup; + private void received(Channel c) { if (c.isGroupSeparator()) { - channelGroups.add(c.getName()); + currentGroup = c.getName(); + channelGroups.add(currentGroup); currentChannels = new ArrayList(); groupChannels.put(c.getName(), currentChannels); } else { @@ -112,6 +114,8 @@ public class ChannelClient extends SvdrpClient implements channelGroups.add(""); groupChannels.put("", currentChannels); } + + c.setGroup(currentGroup); channels.add(c); currentChannels.add(c); String provider = c.getProvider(); -- cgit v1.2.3