diff options
| author | Taran Singh <tarandeep@google.com> | 2020-11-18 15:04:27 -0800 |
|---|---|---|
| committer | Taran Singh <tarandeep@google.com> | 2020-12-21 05:57:47 -0800 |
| commit | dc211bfac3e8f6e75f8b9e7a6f31c112f30d4901 (patch) | |
| tree | b8c7fe7f6ec36737f5aae281a12b0982ee89b1de /core/java/android/widget/TextView.java | |
| parent | a0334be887757324e671e09e4563034704c66fb0 (diff) | |
Prevent Fullscreen IME when app is in portrait.
When an app is running in portrait orientation, regardless of
what orientation display is in, IME shouldn't use fullscreen-mode.
Setting IME_FLAG_NO_FULLSCREEN in EditorInfo makes sure IME doesn't go
fullscreen.
Bug: 157870379
Test: Manually using steps in bug
Change-Id: I5a5e73e1dec776665f28a7e2eb091b555198001b
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 12c91fac0c65..977a0e89a143 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -17,6 +17,7 @@ package android.widget; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; +import static android.content.res.Configuration.ORIENTATION_PORTRAIT; import static android.view.ContentInfo.FLAG_CONVERT_TO_PLAIN_TEXT; import static android.view.ContentInfo.SOURCE_AUTOFILL; import static android.view.ContentInfo.SOURCE_CLIPBOARD; @@ -8738,6 +8739,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_ENTER_ACTION; } } + if (getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT) { + outAttrs.internalImeOptions |= EditorInfo.IME_FLAG_APP_WINDOW_PORTRAIT; + } if (isMultilineInputType(outAttrs.inputType)) { // Multi-line text editors should always show an enter key. outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_ENTER_ACTION; |
