From d5642d0a035dadeb5a77d0fc762b3fe2f9a18430 Mon Sep 17 00:00:00 2001 From: andrekir Date: Fri, 6 May 2022 17:25:35 -0300 Subject: [PATCH] use standard IM text input convention (cherry picked from commit 99dfc8014ae5f95a9a20d44ba82660895e851a47) --- .../main/java/com/geeksville/mesh/ui/MessagesFragment.kt | 3 --- app/src/main/res/layout/messages_fragment.xml | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt index 7914a7968..33738d0c2 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt @@ -57,9 +57,6 @@ class MessagesFragment : Fragment(), Logging { // Allows textMultiline with IME_ACTION_SEND private fun EditText.onActionSend(func: () -> Unit) { - imeOptions = EditorInfo.IME_ACTION_SEND - InputType.TYPE_TEXT_FLAG_MULTI_LINE - setRawInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES) setOnEditorActionListener { _, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_SEND) { diff --git a/app/src/main/res/layout/messages_fragment.xml b/app/src/main/res/layout/messages_fragment.xml index 6b530d758..5cbbd5b92 100644 --- a/app/src/main/res/layout/messages_fragment.xml +++ b/app/src/main/res/layout/messages_fragment.xml @@ -46,8 +46,8 @@ android:id="@+id/textInputLayout" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginBottom="8dp" + android:layout_marginStart="4dp" + android:layout_marginBottom="4dp" android:hint="@string/send_text" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/sendButton" @@ -57,6 +57,7 @@ android:id="@+id/messageInputText" android:layout_width="match_parent" android:layout_height="wrap_content" + android:inputType="textMultiLine|textCapSentences" android:maxLength="228" android:text="" /> @@ -66,7 +67,6 @@ android:id="@+id/sendButton" android:layout_width="64dp" android:layout_height="64dp" - android:layout_marginBottom="4dp" android:contentDescription="@string/send_text" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent"