Fix tab key's navigation behavior
Bug: 6435484 Change-Id: Iffe459c117ad438e96ec6f5c7e64fb80b32d227emain
parent
7aeb7ef1ab
commit
b28934adac
|
@ -133,6 +133,17 @@
|
|||
latin:keyIconPreview="!icon/tab_key_preview"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<case
|
||||
latin:keyboardLayoutSetElement="alphabet|alphabetAutomaticShifted|alphabetShiftLocked"
|
||||
latin:navigateNext="true"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:code="!code/key_action_next"
|
||||
latin:keyIcon="!icon/tab_key"
|
||||
latin:keyIconPreview="!icon/tab_key_preview"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<default>
|
||||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
|
|
|
@ -117,6 +117,17 @@
|
|||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<case
|
||||
latin:keyboardLayoutSetElement="alphabet|alphabetAutomaticShifted|alphabetShiftLocked"
|
||||
latin:navigateNext="true"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:code="!code/key_action_next"
|
||||
latin:keyLabel="!text/label_tab_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<default>
|
||||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
|
|
|
@ -137,11 +137,13 @@ public class KeyboardId {
|
|||
}
|
||||
|
||||
public boolean navigateNext() {
|
||||
return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0;
|
||||
return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0
|
||||
|| imeAction() == EditorInfo.IME_ACTION_NEXT;
|
||||
}
|
||||
|
||||
public boolean navigatePrevious() {
|
||||
return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0;
|
||||
return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0
|
||||
|| imeAction() == EditorInfo.IME_ACTION_PREVIOUS;
|
||||
}
|
||||
|
||||
public boolean passwordInput() {
|
||||
|
|
|
@ -29,7 +29,6 @@ public class InputAttributes {
|
|||
final public boolean mInputTypeNoAutoCorrect;
|
||||
final public boolean mIsSettingsSuggestionStripOn;
|
||||
final public boolean mApplicationSpecifiedCompletionOn;
|
||||
final public int mEditorAction;
|
||||
|
||||
public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) {
|
||||
final int inputType = null != editorInfo ? editorInfo.inputType : 0;
|
||||
|
@ -92,8 +91,6 @@ public class InputAttributes {
|
|||
|
||||
mApplicationSpecifiedCompletionOn = flagAutoComplete && isFullscreenMode;
|
||||
}
|
||||
mEditorAction = (editorInfo == null) ? EditorInfo.IME_ACTION_UNSPECIFIED
|
||||
: editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
|
|
@ -1276,10 +1276,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
}
|
||||
break;
|
||||
default:
|
||||
if (primaryCode == Keyboard.CODE_TAB && mCurrentSettings.isEditorActionNext()) {
|
||||
performEditorAction(EditorInfo.IME_ACTION_NEXT);
|
||||
break;
|
||||
}
|
||||
mSpaceState = SPACE_STATE_NONE;
|
||||
if (mCurrentSettings.isWordSeparator(primaryCode)) {
|
||||
didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState);
|
||||
|
|
|
@ -224,10 +224,6 @@ public class SettingsValues {
|
|||
return mInputAttributes.mApplicationSpecifiedCompletionOn;
|
||||
}
|
||||
|
||||
public boolean isEditorActionNext() {
|
||||
return mInputAttributes.mEditorAction == EditorInfo.IME_ACTION_NEXT;
|
||||
}
|
||||
|
||||
public boolean isSuggestionsRequested(final int displayOrientation) {
|
||||
return mInputAttributes.mIsSettingsSuggestionStripOn
|
||||
&& (mCorrectionEnabled
|
||||
|
|
Loading…
Reference in New Issue