From 00a85c44383670839141a01098c2f7ae209cd1f2 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Mon, 6 Jul 2015 17:24:40 -0700 Subject: [PATCH] fix landscape softkey sizing Closes #3540 // FREEBIE --- res/values/styles.xml | 2 +- .../thoughtcrime/securesms/ConversationActivity.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/res/values/styles.xml b/res/values/styles.xml index 94f39187a4..2f59733247 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -185,7 +185,7 @@ sentences true center_vertical - actionSend|flagNoEnterAction|flagNoExtractUi + flagNoEnterAction textAutoCorrect|textCapSentences|textMultiLine @string/conversation_activity__compose_description diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 63df091c51..a6c5a18571 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -52,6 +52,7 @@ import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; +import android.widget.TextView.OnEditorActionListener; import android.widget.Toast; import com.afollestad.materialdialogs.AlertDialogWrapper; @@ -734,6 +735,15 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity composeText.setInputType (composeText.getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE); composeText.setImeOptions(composeText.getImeOptions() | EditorInfo.IME_FLAG_NO_ENTER_ACTION); } + composeText.setOnEditorActionListener(new OnEditorActionListener() { + @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_SEND) { + sendMessage(); + return true; + } + return false; + } + }); } private void initializeViews() { @@ -771,6 +781,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity public void onChange(TransportOption newTransport) { calculateCharactersRemaining(); composeText.setHint(newTransport.getComposeHint()); + composeText.setImeActionLabel(newTransport.getComposeHint(), EditorInfo.IME_ACTION_SEND); buttonToggle.getBackground().setColorFilter(newTransport.getBackgroundColor(), Mode.MULTIPLY); } }); @@ -825,7 +836,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } private void showEmojiPopup() { - Log.w(TAG, "showEmojiPopup()"); int height = Math.max(getResources().getDimensionPixelSize(R.dimen.min_emoji_drawer_height), container.getKeyboardHeight()); container.padForCustomKeyboard(height);