diff --git a/app/internal/wm/GioView.java b/app/internal/wm/GioView.java index d42d44b7..80762529 100644 --- a/app/internal/wm/GioView.java +++ b/app/internal/wm/GioView.java @@ -266,9 +266,7 @@ public final class GioView extends SurfaceView implements Choreographer.FrameCal } @Override public InputConnection onCreateInputConnection(EditorInfo editor) { - // The TYPE_TEXT_FLAG_NO_SUGGESTIONS and TYPE_TEXT_VARIATION_VISIBLE_PASSWORD are used to fix the - // Samsung keyboard compatibility, forcing to disable the suggests/auto-complete. gio#116. - editor.inputType = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | this.keyboardHint; + editor.inputType = this.keyboardHint; editor.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN | EditorInfo.IME_FLAG_NO_EXTRACT_UI; return new InputConnection(this); } diff --git a/app/internal/wm/os_android.go b/app/internal/wm/os_android.go index 1f5e993b..0230c0ac 100644 --- a/app/internal/wm/os_android.go +++ b/app/internal/wm/os_android.go @@ -616,10 +616,12 @@ func (w *window) ShowTextInput(show bool) { func (w *window) SetInputHint(mode key.InputHint) { // Constants defined at https://developer.android.com/reference/android/text/InputType. const ( - TYPE_NULL = 0 - TYPE_CLASS_NUMBER = 2 - TYPE_NUMBER_FLAG_DECIMAL = 8192 - TYPE_NUMBER_FLAG_SIGNED = 4096 + TYPE_NULL = 0 + TYPE_CLASS_NUMBER = 2 + TYPE_NUMBER_FLAG_DECIMAL = 8192 + TYPE_NUMBER_FLAG_SIGNED = 4096 + TYPE_TEXT_FLAG_NO_SUGGESTIONS = 524288 + TYPE_TEXT_VARIATION_VISIBLE_PASSWORD = 144 ) runInJVM(javaVM(), func(env *C.JNIEnv) { @@ -628,9 +630,14 @@ func (w *window) SetInputHint(mode key.InputHint) { case key.HintNumeric: m = TYPE_CLASS_NUMBER | TYPE_NUMBER_FLAG_DECIMAL | TYPE_NUMBER_FLAG_SIGNED default: - // TYPE_NULL, since TYPE_CLASS_TEXT isn't currently supported (gio#116), so TYPE_NULL is used instead. + // TYPE_NULL, since TYPE_CLASS_TEXT isn't currently supported. m = TYPE_NULL } + + // The TYPE_TEXT_FLAG_NO_SUGGESTIONS and TYPE_TEXT_VARIATION_VISIBLE_PASSWORD are used to fix the + // Samsung keyboard compatibility, forcing to disable the suggests/auto-complete. gio#116. + m = m | TYPE_TEXT_FLAG_NO_SUGGESTIONS | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD + callVoidMethod(env, w.view, gioView.setInputHint, m) }) }