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

View File

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