1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-25 18:32:15 -05:00

Push channel events to switched view if needed

This commit is contained in:
Sebastian Kaspari 2010-03-08 21:44:42 +01:00
parent 7ce77cf119
commit 63dfbc0034
2 changed files with 8 additions and 3 deletions

View File

@ -41,7 +41,7 @@ public class DeckAdapter extends BaseAdapter
{ {
private HashMap<String, MessageListView> map = new HashMap<String, MessageListView>(); private HashMap<String, MessageListView> map = new HashMap<String, MessageListView>();
private LinkedList<Channel> channels = new LinkedList<Channel>(); private LinkedList<Channel> channels = new LinkedList<Channel>();
private View currentView; private MessageListView currentView;
private String currentChannel; private String currentChannel;
private int width; private int width;
@ -128,7 +128,7 @@ public class DeckAdapter extends BaseAdapter
* *
* @param switched * @param switched
*/ */
public void setSwitched(String channel, View current) public void setSwitched(String channel, MessageListView current)
{ {
currentChannel = channel; currentChannel = channel;
currentView = current; currentView = current;
@ -139,7 +139,7 @@ public class DeckAdapter extends BaseAdapter
* *
* @return * @return
*/ */
public View getSwitchedView() public MessageListView getSwitchedView()
{ {
return currentView; return currentView;
} }

View File

@ -226,6 +226,11 @@ public class ServerActivity extends Activity implements ServiceConnection, Chann
MessageListAdapter adapter = view.getAdapter(); MessageListAdapter adapter = view.getAdapter();
adapter.addMessage(message); adapter.addMessage(message);
} }
if (deckAdapter.isSwitched()) {
MessageListView switchedView = deckAdapter.getSwitchedView();
switchedView.getAdapter().addMessage(message);
}
} }
/** /**