Tab key is shown when editor navigation flag is set
Previously tab key is shown only when the input type variant says that it is web input. In addition to that, this change also shows tab key when the IME option includes editor action (next and/or previous) flag. Bug: 3094312 Change-Id: I3f8841fdbcee918a0f93f3259090f24e70d96471main
parent
1b7362b59b
commit
28a38fdfee
|
@ -221,7 +221,7 @@
|
||||||
<enum name="phone" value="4" />
|
<enum name="phone" value="4" />
|
||||||
<enum name="number" value="5" />
|
<enum name="number" value="5" />
|
||||||
</attr>
|
</attr>
|
||||||
<attr name="webInput" format="boolean" />
|
<attr name="navigateAction" format="boolean" />
|
||||||
<attr name="passwordInput" format="boolean" />
|
<attr name="passwordInput" format="boolean" />
|
||||||
<attr name="hasSettingsKey" format="boolean" />
|
<attr name="hasSettingsKey" format="boolean" />
|
||||||
<attr name="voiceKeyEnabled" format="boolean" />
|
<attr name="voiceKeyEnabled" format="boolean" />
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</case>
|
</case>
|
||||||
<!-- latin:hasVoiceKey="false" -->
|
<!-- latin:hasVoiceKey="false" -->
|
||||||
<case
|
<case
|
||||||
latin:webInput="true"
|
latin:navigateAction="true"
|
||||||
>
|
>
|
||||||
<Key
|
<Key
|
||||||
latin:keyLabel="."
|
latin:keyLabel="."
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
</switch>
|
</switch>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:webInput="true"
|
latin:navigateAction="true"
|
||||||
>
|
>
|
||||||
<Key
|
<Key
|
||||||
latin:keyStyle="tabKeyStyle"
|
latin:keyStyle="tabKeyStyle"
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class EditorInfoCompatUtils {
|
||||||
private static final Field FIELD_IME_FLAG_NAVIGATE_PREVIOUS = CompatUtils.getField(
|
private static final Field FIELD_IME_FLAG_NAVIGATE_PREVIOUS = CompatUtils.getField(
|
||||||
EditorInfo.class, "IME_FLAG_NAVIGATE_PREVIOUS");
|
EditorInfo.class, "IME_FLAG_NAVIGATE_PREVIOUS");
|
||||||
private static final Field FIELD_IME_ACTION_PREVIOUS = CompatUtils.getField(
|
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
|
private static final Integer OBJ_IME_FLAG_NAVIGATE_NEXT = (Integer) CompatUtils
|
||||||
.getFieldValue(null, null, FIELD_IME_FLAG_NAVIGATE_NEXT);
|
.getFieldValue(null, null, FIELD_IME_FLAG_NAVIGATE_NEXT);
|
||||||
private static final Integer OBJ_IME_FLAG_NAVIGATE_PREVIOUS = (Integer) CompatUtils
|
private static final Integer OBJ_IME_FLAG_NAVIGATE_PREVIOUS = (Integer) CompatUtils
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class KeyboardId {
|
||||||
public final int mMode;
|
public final int mMode;
|
||||||
public final int mXmlId;
|
public final int mXmlId;
|
||||||
public final int mColorScheme;
|
public final int mColorScheme;
|
||||||
public final boolean mWebInput;
|
public final boolean mNavigateAction;
|
||||||
public final boolean mPasswordInput;
|
public final boolean mPasswordInput;
|
||||||
public final boolean mHasSettingsKey;
|
public final boolean mHasSettingsKey;
|
||||||
public final boolean mVoiceKeyEnabled;
|
public final boolean mVoiceKeyEnabled;
|
||||||
|
@ -67,7 +67,9 @@ public class KeyboardId {
|
||||||
this.mMode = mode;
|
this.mMode = mode;
|
||||||
this.mXmlId = xmlId;
|
this.mXmlId = xmlId;
|
||||||
this.mColorScheme = colorScheme;
|
this.mColorScheme = colorScheme;
|
||||||
this.mWebInput = InputTypeCompatUtils.isWebInputType(inputType);
|
this.mNavigateAction = InputTypeCompatUtils.isWebInputType(inputType)
|
||||||
|
|| EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions)
|
||||||
|
|| EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions);
|
||||||
this.mPasswordInput = InputTypeCompatUtils.isPasswordInputType(inputType)
|
this.mPasswordInput = InputTypeCompatUtils.isPasswordInputType(inputType)
|
||||||
|| InputTypeCompatUtils.isVisiblePasswordInputType(inputType);
|
|| InputTypeCompatUtils.isVisiblePasswordInputType(inputType);
|
||||||
this.mHasSettingsKey = hasSettingsKey;
|
this.mHasSettingsKey = hasSettingsKey;
|
||||||
|
@ -89,7 +91,7 @@ public class KeyboardId {
|
||||||
mode,
|
mode,
|
||||||
xmlId,
|
xmlId,
|
||||||
colorScheme,
|
colorScheme,
|
||||||
mWebInput,
|
mNavigateAction,
|
||||||
mPasswordInput,
|
mPasswordInput,
|
||||||
hasSettingsKey,
|
hasSettingsKey,
|
||||||
voiceKeyEnabled,
|
voiceKeyEnabled,
|
||||||
|
@ -143,7 +145,7 @@ public class KeyboardId {
|
||||||
&& other.mMode == this.mMode
|
&& other.mMode == this.mMode
|
||||||
&& other.mXmlId == this.mXmlId
|
&& other.mXmlId == this.mXmlId
|
||||||
&& other.mColorScheme == this.mColorScheme
|
&& other.mColorScheme == this.mColorScheme
|
||||||
&& other.mWebInput == this.mWebInput
|
&& other.mNavigateAction == this.mNavigateAction
|
||||||
&& other.mPasswordInput == this.mPasswordInput
|
&& other.mPasswordInput == this.mPasswordInput
|
||||||
&& other.mHasSettingsKey == this.mHasSettingsKey
|
&& other.mHasSettingsKey == this.mHasSettingsKey
|
||||||
&& other.mVoiceKeyEnabled == this.mVoiceKeyEnabled
|
&& other.mVoiceKeyEnabled == this.mVoiceKeyEnabled
|
||||||
|
@ -166,7 +168,7 @@ public class KeyboardId {
|
||||||
modeName(mMode),
|
modeName(mMode),
|
||||||
EditorInfoCompatUtils.imeOptionsName(mImeAction),
|
EditorInfoCompatUtils.imeOptionsName(mImeAction),
|
||||||
colorSchemeName(mColorScheme),
|
colorSchemeName(mColorScheme),
|
||||||
(mWebInput ? " webInput" : ""),
|
(mNavigateAction ? " navigateAction" : ""),
|
||||||
(mPasswordInput ? " passwordInput" : ""),
|
(mPasswordInput ? " passwordInput" : ""),
|
||||||
(mHasSettingsKey ? " hasSettingsKey" : ""),
|
(mHasSettingsKey ? " hasSettingsKey" : ""),
|
||||||
(mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),
|
(mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),
|
||||||
|
|
|
@ -473,8 +473,8 @@ public class KeyboardParser {
|
||||||
try {
|
try {
|
||||||
final boolean modeMatched = matchTypedValue(a,
|
final boolean modeMatched = matchTypedValue(a,
|
||||||
R.styleable.Keyboard_Case_mode, id.mMode, KeyboardId.modeName(id.mMode));
|
R.styleable.Keyboard_Case_mode, id.mMode, KeyboardId.modeName(id.mMode));
|
||||||
final boolean webInputMatched = matchBoolean(a,
|
final boolean navigateActionMatched = matchBoolean(a,
|
||||||
R.styleable.Keyboard_Case_webInput, id.mWebInput);
|
R.styleable.Keyboard_Case_navigateAction, id.mNavigateAction);
|
||||||
final boolean passwordInputMatched = matchBoolean(a,
|
final boolean passwordInputMatched = matchBoolean(a,
|
||||||
R.styleable.Keyboard_Case_passwordInput, id.mPasswordInput);
|
R.styleable.Keyboard_Case_passwordInput, id.mPasswordInput);
|
||||||
final boolean settingsKeyMatched = matchBoolean(a,
|
final boolean settingsKeyMatched = matchBoolean(a,
|
||||||
|
@ -497,7 +497,7 @@ public class KeyboardParser {
|
||||||
R.styleable.Keyboard_Case_languageCode, id.mLocale.getLanguage());
|
R.styleable.Keyboard_Case_languageCode, id.mLocale.getLanguage());
|
||||||
final boolean countryCodeMatched = matchString(a,
|
final boolean countryCodeMatched = matchString(a,
|
||||||
R.styleable.Keyboard_Case_countryCode, id.mLocale.getCountry());
|
R.styleable.Keyboard_Case_countryCode, id.mLocale.getCountry());
|
||||||
final boolean selected = modeMatched && webInputMatched && passwordInputMatched
|
final boolean selected = modeMatched && navigateActionMatched && passwordInputMatched
|
||||||
&& settingsKeyMatched && voiceEnabledMatched && voiceKeyMatched
|
&& settingsKeyMatched && voiceEnabledMatched && voiceKeyMatched
|
||||||
&& colorSchemeMatched && imeActionMatched && localeCodeMatched
|
&& colorSchemeMatched && imeActionMatched && localeCodeMatched
|
||||||
&& languageCodeMatched && countryCodeMatched;
|
&& languageCodeMatched && countryCodeMatched;
|
||||||
|
@ -507,7 +507,7 @@ public class KeyboardParser {
|
||||||
textAttr(KeyboardId.colorSchemeName(
|
textAttr(KeyboardId.colorSchemeName(
|
||||||
viewAttr.getInt(
|
viewAttr.getInt(
|
||||||
R.styleable.KeyboardView_colorScheme, -1)), "colorScheme"),
|
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_passwordInput, "passwordInput"),
|
||||||
booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, "hasSettingsKey"),
|
booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, "hasSettingsKey"),
|
||||||
booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
|
booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
|
||||||
|
|
Loading…
Reference in New Issue