aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-09-04 14:48:00 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-09-04 14:48:00 +0200
commit204cee4a17cf97aaf393700782bd0bcd65e12341 (patch)
tree33af66a42051ffe33c8aeed4b55b0be24ecb02c0
parentb265341848863c864a63a079032cbe3fbd89dfd5 (diff)
show an send button instead of the enter key in softkeyboards when enterIsSend and showEnterKey are both setshow_send_button_in_softkeyboard
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java1
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java16
2 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index e7f45399..9abc1d8b 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -969,6 +969,7 @@ public class ConversationActivity extends XmppActivity
} else {
this.mConversationFragment.messageListAdapter.updatePreferences();
this.mConversationFragment.messagesView.invalidateViews();
+ this.mConversationFragment.setupIme();
}
if(!forbidProcessingPendings) {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 2d628871..1757ebd8 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -345,21 +345,24 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
}
- private void setupIme() {
- if (((ConversationActivity) getActivity()).usingEnterKey()) {
+ public void setupIme() {
+ if (activity.usingEnterKey() && activity.enterIsSend()) {
+ mEditMessage.setInputType(mEditMessage.getInputType() & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));
+ mEditMessage.setInputType(mEditMessage.getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
+ } else if (activity.usingEnterKey()) {
+ mEditMessage.setInputType(mEditMessage.getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
mEditMessage.setInputType(mEditMessage.getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
} else {
+ mEditMessage.setInputType(mEditMessage.getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
mEditMessage.setInputType(mEditMessage.getInputType() | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
}
}
@Override
- public View onCreateView(final LayoutInflater inflater,
- ViewGroup container, Bundle savedInstanceState) {
+ public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_conversation, container, false);
view.setOnClickListener(null);
mEditMessage = (EditMessage) view.findViewById(R.id.textinput);
- setupIme();
mEditMessage.setOnClickListener(new OnClickListener() {
@Override
@@ -639,9 +642,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
if (conversation == null) {
return;
}
-
this.activity = (ConversationActivity) getActivity();
-
+ setupIme();
if (this.conversation != null) {
final String msg = mEditMessage.getText().toString();
this.conversation.setNextMessage(msg);