From 77fd0db39ba1e5ebbfb013ac9dbb212b40c29d89 Mon Sep 17 00:00:00 2001 From: Dimo Karaivanov Date: Tue, 22 Aug 2023 11:57:33 +0300 Subject: [PATCH] Predictive mode is now allowed in all text fields, but password fields. No more unnecessary constraints --- .../sspanak/tt9/ime/helpers/TextField.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/io/github/sspanak/tt9/ime/helpers/TextField.java b/src/io/github/sspanak/tt9/ime/helpers/TextField.java index 4a39caad..fc7e2bf4 100644 --- a/src/io/github/sspanak/tt9/ime/helpers/TextField.java +++ b/src/io/github/sspanak/tt9/ime/helpers/TextField.java @@ -71,8 +71,6 @@ public class TextField { * @return ArrayList */ public ArrayList determineInputModes(InputType inputType) { - final int INPUT_TYPE_SHARP_007H_PHONE_BOOK = 65633; - ArrayList allowedModes = new ArrayList<>(); if (field == null) { @@ -80,19 +78,7 @@ public class TextField { return allowedModes; } - if ( - field.inputType == INPUT_TYPE_SHARP_007H_PHONE_BOOK - || ( - field.privateImeOptions != null - && field.privateImeOptions.equals("io.github.sspanak.tt9.addword=true") - ) - ) { - allowedModes.add(InputMode.MODE_123); - allowedModes.add(InputMode.MODE_ABC); - return allowedModes; - } - - // Calculators (support only 0-9 and math) and Dialer (0-9, "#" and "*"), + // Calculators (only 0-9 and math) and Dialer (0-9, "#" and "*") fields // handle all input themselves, so we are supposed to pass through all key presses. // Note: A Dialer field is not a Phone number field. if (inputType.isSpecialNumeric()) { @@ -114,7 +100,7 @@ public class TextField { // normal alphabetic keyboard, and assume that we should // be doing predictive text (showing candidates as the // user types). - if (!inputType.isPassword() && !inputType.isFilter()) { + if (!inputType.isPassword()) { allowedModes.add(InputMode.MODE_PREDICTIVE); }