diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 2db529ea2765a08efe47ac88cb805da009db4ba1..73f62c6f11e80fc7a16512ea1cf788ef9442c09c 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -221,7 +221,7 @@ <enum name="phone" value="4" /> <enum name="number" value="5" /> </attr> - <attr name="webInput" format="boolean" /> + <attr name="navigateAction" format="boolean" /> <attr name="passwordInput" format="boolean" /> <attr name="hasSettingsKey" format="boolean" /> <attr name="voiceKeyEnabled" format="boolean" /> diff --git a/java/res/xml/kbd_qwerty_f1.xml b/java/res/xml/kbd_qwerty_f1.xml index e89d02d913626c8b36709d810bee5f3346a30375..88dfab11612935fbe8345b5ccc236dd437afbc53 100644 --- a/java/res/xml/kbd_qwerty_f1.xml +++ b/java/res/xml/kbd_qwerty_f1.xml @@ -46,7 +46,7 @@ </case> <!-- latin:hasVoiceKey="false" --> <case - latin:webInput="true" + latin:navigateAction="true" > <Key latin:keyLabel="." diff --git a/java/res/xml/kbd_qwerty_row4.xml b/java/res/xml/kbd_qwerty_row4.xml index dfe5de359ad310a5cc422906cdd240fd1641776d..95be66dfa57b0539666a9a9e72e8b2e85db827e4 100644 --- a/java/res/xml/kbd_qwerty_row4.xml +++ b/java/res/xml/kbd_qwerty_row4.xml @@ -56,7 +56,7 @@ </switch> <switch> <case - latin:webInput="true" + latin:navigateAction="true" > <Key latin:keyStyle="tabKeyStyle" diff --git a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java index 2789bcb39cd4b4f9aee0f7bdadf8a823b67a10e4..bcdcef7dc086dc6ca4bec8d7fdad89e5a9c9cb1f 100644 --- a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java @@ -27,7 +27,7 @@ public class EditorInfoCompatUtils { private static final Field FIELD_IME_FLAG_NAVIGATE_PREVIOUS = CompatUtils.getField( EditorInfo.class, "IME_FLAG_NAVIGATE_PREVIOUS"); private static final Field FIELD_IME_ACTION_PREVIOUS = CompatUtils.getField( - EditorInfo.class, "IME_FLAG_ACTION_PREVIOUS"); + EditorInfo.class, "IME_ACTION_PREVIOUS"); private static final Integer OBJ_IME_FLAG_NAVIGATE_NEXT = (Integer) CompatUtils .getFieldValue(null, null, FIELD_IME_FLAG_NAVIGATE_NEXT); private static final Integer OBJ_IME_FLAG_NAVIGATE_PREVIOUS = (Integer) CompatUtils diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index 7c03ec71e2b0afced553ce546ff688e9abb3fea7..cdaed95a52edaecbc3cdac0d3b60ec410a8a5967 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -43,7 +43,7 @@ public class KeyboardId { public final int mMode; public final int mXmlId; public final int mColorScheme; - public final boolean mWebInput; + public final boolean mNavigateAction; public final boolean mPasswordInput; public final boolean mHasSettingsKey; public final boolean mVoiceKeyEnabled; @@ -67,7 +67,9 @@ public class KeyboardId { this.mMode = mode; this.mXmlId = xmlId; this.mColorScheme = colorScheme; - this.mWebInput = InputTypeCompatUtils.isWebInputType(inputType); + this.mNavigateAction = InputTypeCompatUtils.isWebInputType(inputType) + || EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions) + || EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions); this.mPasswordInput = InputTypeCompatUtils.isPasswordInputType(inputType) || InputTypeCompatUtils.isVisiblePasswordInputType(inputType); this.mHasSettingsKey = hasSettingsKey; @@ -89,7 +91,7 @@ public class KeyboardId { mode, xmlId, colorScheme, - mWebInput, + mNavigateAction, mPasswordInput, hasSettingsKey, voiceKeyEnabled, @@ -143,7 +145,7 @@ public class KeyboardId { && other.mMode == this.mMode && other.mXmlId == this.mXmlId && other.mColorScheme == this.mColorScheme - && other.mWebInput == this.mWebInput + && other.mNavigateAction == this.mNavigateAction && other.mPasswordInput == this.mPasswordInput && other.mHasSettingsKey == this.mHasSettingsKey && other.mVoiceKeyEnabled == this.mVoiceKeyEnabled @@ -166,7 +168,7 @@ public class KeyboardId { modeName(mMode), EditorInfoCompatUtils.imeOptionsName(mImeAction), colorSchemeName(mColorScheme), - (mWebInput ? " webInput" : ""), + (mNavigateAction ? " navigateAction" : ""), (mPasswordInput ? " passwordInput" : ""), (mHasSettingsKey ? " hasSettingsKey" : ""), (mVoiceKeyEnabled ? " voiceKeyEnabled" : ""), diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java index a6158d0ad0fcf555b7b493ad860122e642a431c5..20af12bc5f953f94eba08ffbe96f872c2b51a5b7 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java @@ -473,8 +473,8 @@ public class KeyboardParser { try { final boolean modeMatched = matchTypedValue(a, R.styleable.Keyboard_Case_mode, id.mMode, KeyboardId.modeName(id.mMode)); - final boolean webInputMatched = matchBoolean(a, - R.styleable.Keyboard_Case_webInput, id.mWebInput); + final boolean navigateActionMatched = matchBoolean(a, + R.styleable.Keyboard_Case_navigateAction, id.mNavigateAction); final boolean passwordInputMatched = matchBoolean(a, R.styleable.Keyboard_Case_passwordInput, id.mPasswordInput); final boolean settingsKeyMatched = matchBoolean(a, @@ -497,7 +497,7 @@ public class KeyboardParser { R.styleable.Keyboard_Case_languageCode, id.mLocale.getLanguage()); final boolean countryCodeMatched = matchString(a, R.styleable.Keyboard_Case_countryCode, id.mLocale.getCountry()); - final boolean selected = modeMatched && webInputMatched && passwordInputMatched + final boolean selected = modeMatched && navigateActionMatched && passwordInputMatched && settingsKeyMatched && voiceEnabledMatched && voiceKeyMatched && colorSchemeMatched && imeActionMatched && localeCodeMatched && languageCodeMatched && countryCodeMatched; @@ -507,7 +507,7 @@ public class KeyboardParser { textAttr(KeyboardId.colorSchemeName( viewAttr.getInt( R.styleable.KeyboardView_colorScheme, -1)), "colorScheme"), - booleanAttr(a, R.styleable.Keyboard_Case_webInput, "webInput"), + booleanAttr(a, R.styleable.Keyboard_Case_navigateAction, "navigateAction"), booleanAttr(a, R.styleable.Keyboard_Case_passwordInput, "passwordInput"), booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, "hasSettingsKey"), booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),