Skip to content
Snippets Groups Projects
Commit 32137dc4 authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez
Browse files

text messages: don't send if empty

Tuleap: #123
Change-Id: I70af840996fb6f7b78a863a90de39f10eedcb7b2
parent 39e42593
No related branches found
No related tags found
No related merge requests found
...@@ -193,8 +193,11 @@ public class ConversationActivity extends AppCompatActivity { ...@@ -193,8 +193,11 @@ public class ConversationActivity extends AppCompatActivity {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
switch (actionId) { switch (actionId) {
case EditorInfo.IME_ACTION_SEND: case EditorInfo.IME_ACTION_SEND:
CharSequence txt = msgEditTxt.getText();
if (txt.length() > 0) {
onSendTextMessage(msgEditTxt.getText().toString()); onSendTextMessage(msgEditTxt.getText().toString());
msgEditTxt.setText(""); msgEditTxt.setText("");
}
return true; return true;
} }
return false; return false;
...@@ -204,9 +207,12 @@ public class ConversationActivity extends AppCompatActivity { ...@@ -204,9 +207,12 @@ public class ConversationActivity extends AppCompatActivity {
msgSendBtn.setOnClickListener(new View.OnClickListener() { msgSendBtn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
onSendTextMessage(msgEditTxt.getText().toString()); CharSequence txt = msgEditTxt.getText();
if (txt.length() > 0) {
onSendTextMessage(txt.toString());
msgEditTxt.setText(""); msgEditTxt.setText("");
} }
}
}); });
bottomPane = (ViewGroup) findViewById(R.id.ongoingcall_pane); bottomPane = (ViewGroup) findViewById(R.id.ongoingcall_pane);
bottomPane.setVisibility(View.GONE); bottomPane.setVisibility(View.GONE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment