Commit 540617f6 authored by Biao She's avatar Biao She Committed by Commit Bot

Fix text wrapping issue

This CL fix text wrapping issue. It also fixes text in Buttons do not
transform to upper case.

Bug: 814988
Change-Id: I1ba4d4270f5cf0d315ddf9aad4c7c3171be020e2
Reviewed-on: https://chromium-review.googlesource.com/964990Reviewed-by: default avatarAmirhossein Simjour <asimjour@chromium.org>
Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Commit-Queue: Biao She <bshe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543705}
parent 7319f93a
...@@ -65,7 +65,19 @@ public class VrDialog extends FrameLayout { ...@@ -65,7 +65,19 @@ public class VrDialog extends FrameLayout {
if (view instanceof ViewGroup) { if (view instanceof ViewGroup) {
disableSoftKeyboard((ViewGroup) view); disableSoftKeyboard((ViewGroup) view);
} else if (view instanceof TextView) { } else if (view instanceof TextView) {
((TextView) view).setInputType(InputType.TYPE_NULL); TextView text = (TextView) view;
// It is important to avoid setting InputType to NULL again. Otherwise, it will
// change the TextView to single line mode and cause other unexpected issues(such as
// text in button is not captiablized).
int type = text.getInputType();
if (type != InputType.TYPE_NULL) {
text.setInputType(InputType.TYPE_NULL);
// If the TextView has multi line flag, reset line mode to multi line.
if ((type & (InputType.TYPE_MASK_CLASS | InputType.TYPE_TEXT_FLAG_MULTI_LINE))
== (InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE)) {
text.setSingleLine(false);
}
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment