Skip to content

Commit

Permalink
Android: Show correct keyboard when using Gboard and Japanese layout
Browse files Browse the repository at this point in the history
In 71a6383 a workaround for Samsung
devices using ImhNoPredictiveText was included as there is a bug on
those devices. However this causes a problem with other keyboards such
as Gboard when using languages such as Japanese, as it would not show
the right keyboard at all and only showed a qwerty one in those cases.

Therefore we default to not working around the issue as it is more of a
problem to not allow certain keyboard layouts as opposed to having
predictive text even if it is turned off. For those who want to disable
predictive text and as such have the consequences of not showing some
keyboard layouts, they can set the
QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT environment
variable.

[ChangeLog][Platform Specific Changes][Android] Text fields with
ImhNoPredictiveText set are no longer working around keyboards that
disregard this setting. To enforce the workaround then the environment
variable - QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT
should be set.

Change-Id: I9ace7ba96ebad68987b53783e25067b66c002f25
Reviewed-by: Paul Olav Tvete <[email protected]>
  • Loading branch information
AndyShawQt committed Feb 28, 2019
1 parent 8880ef7 commit 11c7287
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ public void showSoftwareKeyboard(final int x, final int y, final int width, fina
}
} else if ((inputHints & ImhHiddenText) != 0) {
inputType |= android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD;
} else if ((inputHints & ImhSensitiveData) != 0 || (inputHints & ImhNoPredictiveText) != 0) {
} else if ((inputHints & ImhSensitiveData) != 0 ||
((inputHints & ImhNoPredictiveText) != 0 &&
System.getenv("QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT") != null)) {
inputType |= android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
}

Expand Down

0 comments on commit 11c7287

Please sign in to comment.