mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-25 18:32:15 -05:00
Show error if user is not connected but sends a message
This commit is contained in:
parent
0570e3d638
commit
031c042d50
BIN
res/drawable/error.png
Normal file
BIN
res/drawable/error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 523 B |
@ -343,6 +343,14 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
public boolean onKey(View view, int keyCode, KeyEvent event)
|
||||
{
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (!server.isConnected()) {
|
||||
Message message = new Message("Not connected");
|
||||
message.setColor(Message.COLOR_RED);
|
||||
message.setIcon(R.drawable.error);
|
||||
server.getConversation(server.getSelectedConversation()).addMessage(message);
|
||||
onConversationMessage(server.getSelectedConversation());
|
||||
}
|
||||
|
||||
EditText input = (EditText) view;
|
||||
String text = input.getText().toString();
|
||||
input.setText("");
|
||||
|
Loading…
Reference in New Issue
Block a user