From e67eca77ff706a6d66cc0cc00358ce35a7f0386e Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Wed, 17 Apr 2019 08:28:20 -0400 Subject: [PATCH] Prevent landscape text editing from taking over the screen. It used to be that we let Android do the default behavior of full-screening the EditText when in landscape, but honestly I don't know who prefers that. So I've turned it off. Fixes #8769 --- res/layout/conversation_input_panel.xml | 1 + res/layout/mediasend_fragment.xml | 2 ++ .../securesms/components/KeyboardAwareLinearLayout.java | 5 ----- .../thoughtcrime/securesms/scribbles/widget/MotionView.java | 2 ++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/res/layout/conversation_input_panel.xml b/res/layout/conversation_input_panel.xml index cd9ac5b9a0..3b412efff8 100644 --- a/res/layout/conversation_input_panel.xml +++ b/res/layout/conversation_input_panel.xml @@ -89,6 +89,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" + android:imeOptions="flagNoExtractUi" android:nextFocusForward="@+id/send_button" android:nextFocusRight="@+id/send_button" tools:visibility="invisible" diff --git a/res/layout/mediasend_fragment.xml b/res/layout/mediasend_fragment.xml index d8d95529e6..7037fb1995 100644 --- a/res/layout/mediasend_fragment.xml +++ b/res/layout/mediasend_fragment.xml @@ -42,6 +42,7 @@ style="@style/Signal.Text.Body" android:maxLines="3" android:maxLength="240" + android:imeOptions="flagNoExtractUi" android:hint="@string/MediaSendActivity_add_a_caption" android:autoText="true" android:inputType="textAutoCorrect|textCapSentences|textMultiLine" @@ -96,6 +97,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" + android:imeOptions="flagNoExtractUi" android:nextFocusForward="@+id/send_button" android:nextFocusRight="@+id/send_button" tools:hint="Send TextSecure message" > diff --git a/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java b/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java index e23553edf3..d885619b30 100644 --- a/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java +++ b/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java @@ -93,11 +93,6 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat { } private void updateKeyboardState() { - if (isLandscape()) { - if (keyboardOpen) onKeyboardClose(); - return; - } - if (viewInset == 0 && Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) viewInset = getViewInset(); getWindowVisibleDisplayFrame(rect); diff --git a/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java b/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java index e33dbd00b6..6210eef39a 100644 --- a/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java +++ b/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java @@ -45,6 +45,7 @@ import android.view.Gravity; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; +import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.FrameLayout; @@ -133,6 +134,7 @@ public class MotionView extends FrameLayout implements TextWatcher { this.editText.setBackgroundColor(Color.TRANSPARENT); this.editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 1); this.editText.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); + this.editText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); this.addView(editText); this.editText.clearFocus(); this.editText.addTextChangedListener(this);