public class MainActivity extends Activity implements ChatEventListener
Modifier and Type | Class and Description |
---|---|
class |
MainActivity.ProtocolAdapter |
class |
MainActivity.ProtocolItem |
static class |
MainActivity.ProtocolItemType |
Modifier and Type | Field and Description |
---|---|
(package private) Handler |
callbackHandler |
private Chat |
chat |
private ConnectivityManager |
conman |
private MainActivity.ProtocolAdapter |
listAdapter |
private EditText |
message |
private NetworkInfo |
networkinfo |
private ToggleButton |
registerButton |
private ListView |
responses |
private Button |
sendButton |
private EditText |
username |
Constructor and Description |
---|
MainActivity() |
Modifier and Type | Method and Description |
---|---|
void |
addToProtocol(java.lang.String message,
MainActivity.ProtocolItemType type) |
Handler |
getCallbackHandler() |
private boolean |
isNetworkAvailable() |
void |
onClickRegister(View v) |
void |
onClickSend(View v) |
void |
onClientsReceived(ChatEventSource.ChatEvent event) |
void |
onConnectionStateChange(ChatEventSource.ChatEvent event) |
protected void |
onCreate(Bundle savedInstanceState) |
boolean |
onCreateOptionsMenu(Menu menu) |
void |
onDeregisterResultReceived(ChatEventSource.ChatEvent event) |
void |
onInfoReceived(ChatEventSource.ChatEvent event) |
void |
onMessageReceived(ChatEventSource.ChatEvent event) |
void |
onMessageSendResultReceived(ChatEventSource.ChatEvent event) |
boolean |
onOptionsItemSelected(MenuItem item) |
void |
onRegisterResultReceived(ChatEventSource.ChatEvent event) |
protected void |
onResume() |
void |
showClients() |
void |
syncToChat() |
private ConnectivityManager conman
private NetworkInfo networkinfo
private Chat chat
private EditText username
private EditText message
private ToggleButton registerButton
private Button sendButton
private ListView responses
private MainActivity.ProtocolAdapter listAdapter
final Handler callbackHandler
public Handler getCallbackHandler()
getCallbackHandler
in interface ChatEventListener
protected void onCreate(Bundle savedInstanceState)
public boolean onCreateOptionsMenu(Menu menu)
public boolean onOptionsItemSelected(MenuItem item)
protected void onResume()
public void onClickRegister(View v)
public void onClickSend(View v)
private boolean isNetworkAvailable()
public void addToProtocol(java.lang.String message, MainActivity.ProtocolItemType type)
public void showClients()
public void syncToChat()
public void onRegisterResultReceived(ChatEventSource.ChatEvent event)
onRegisterResultReceived
in interface ChatEventListener
public void onDeregisterResultReceived(ChatEventSource.ChatEvent event)
onDeregisterResultReceived
in interface ChatEventListener
public void onMessageSendResultReceived(ChatEventSource.ChatEvent event)
onMessageSendResultReceived
in interface ChatEventListener
public void onInfoReceived(ChatEventSource.ChatEvent event)
onInfoReceived
in interface ChatEventListener
public void onClientsReceived(ChatEventSource.ChatEvent event)
onClientsReceived
in interface ChatEventListener
public void onMessageReceived(ChatEventSource.ChatEvent event)
onMessageReceived
in interface ChatEventListener
public void onConnectionStateChange(ChatEventSource.ChatEvent event)
onConnectionStateChange
in interface ChatEventListener