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:
parent
7ce77cf119
commit
63dfbc0034
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user