From 4d2a1afaf9bee01c67a25f0f74278c4e12a32af0 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 20 Mar 2017 00:09:23 +0100 Subject: [PATCH] call EditText.setText() instead of clear because clear causes problems on some keyboards --- .../conversations/ui/ConversationFragment.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 50667f5cd..c15217458 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -345,8 +345,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa case CANCEL: if (conversation != null) { if(conversation.setCorrectingMessage(null)) { - mEditMessage.getEditableText().clear(); - mEditMessage.getEditableText().append(conversation.getDraftMessage()); + mEditMessage.setText(""); + mEditMessage.append(conversation.getDraftMessage()); conversation.setDraftMessage(null); } else if (conversation.getMode() == Conversation.MODE_MULTI) { conversation.setNextCounterpart(null); @@ -829,7 +829,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa if (conversation.setOutgoingChatState(Config.DEFAULT_CHATSTATE)) { activity.xmppConnectionService.sendChatState(conversation); } - this.mEditMessage.getEditableText().clear(); + this.mEditMessage.setText(""); this.conversation.setNextCounterpart(counterpart); updateChatMsgHint(); updateSendButton(); @@ -842,8 +842,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa this.conversation.setCorrectingMessage(message); final Editable editable = mEditMessage.getText(); this.conversation.setDraftMessage(editable.toString()); - this.mEditMessage.getEditableText().clear(); - this.mEditMessage.getEditableText().append(message.getBody()); + this.mEditMessage.setText(""); + this.mEditMessage.append(message.getBody()); } @@ -1086,10 +1086,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa protected void messageSent() { mSendingPgpMessage.set(false); - Editable editable = mEditMessage.getEditableText(); - editable.clear(); + mEditMessage.setText(""); if (conversation.setCorrectingMessage(null)) { - editable.append(conversation.getDraftMessage()); + mEditMessage.append(conversation.getDraftMessage()); conversation.setDraftMessage(null); } updateChatMsgHint();