mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
fixed enter is send option
This commit is contained in:
parent
44028a547f
commit
cbca92d209
@ -1012,8 +1012,13 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterPressed() {
|
||||
public boolean onEnterPressed() {
|
||||
if (activity.enterIsSend()) {
|
||||
sendMessage();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,11 +37,10 @@ public class EditMessage extends EditText {
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||
if (keyboardListener != null) {
|
||||
keyboardListener.onEnterPressed();
|
||||
}
|
||||
if (keyboardListener != null && keyboardListener.onEnterPressed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@ -70,7 +69,7 @@ public class EditMessage extends EditText {
|
||||
}
|
||||
|
||||
public interface KeyboardListener {
|
||||
public void onEnterPressed();
|
||||
public boolean onEnterPressed();
|
||||
public void onTypingStarted();
|
||||
public void onTypingStopped();
|
||||
public void onTextDeleted();
|
||||
|
Loading…
Reference in New Issue
Block a user