Fix tab key's navigation behavior

Bug: 6435484
Change-Id: Iffe459c117ad438e96ec6f5c7e64fb80b32d227e
main
Tadashi G. Takaoka 2012-07-05 14:50:10 +09:00
parent 7aeb7ef1ab
commit b28934adac
6 changed files with 26 additions and 13 deletions

View File

@ -133,6 +133,17 @@
latin:keyIconPreview="!icon/tab_key_preview" latin:keyIconPreview="!icon/tab_key_preview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </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> <default>
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"

View File

@ -117,6 +117,17 @@
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </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> <default>
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"

View File

@ -137,11 +137,13 @@ public class KeyboardId {
} }
public boolean navigateNext() { 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() { 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() { public boolean passwordInput() {

View File

@ -29,7 +29,6 @@ public class InputAttributes {
final public boolean mInputTypeNoAutoCorrect; final public boolean mInputTypeNoAutoCorrect;
final public boolean mIsSettingsSuggestionStripOn; final public boolean mIsSettingsSuggestionStripOn;
final public boolean mApplicationSpecifiedCompletionOn; final public boolean mApplicationSpecifiedCompletionOn;
final public int mEditorAction;
public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) { public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) {
final int inputType = null != editorInfo ? editorInfo.inputType : 0; final int inputType = null != editorInfo ? editorInfo.inputType : 0;
@ -92,8 +91,6 @@ public class InputAttributes {
mApplicationSpecifiedCompletionOn = flagAutoComplete && isFullscreenMode; mApplicationSpecifiedCompletionOn = flagAutoComplete && isFullscreenMode;
} }
mEditorAction = (editorInfo == null) ? EditorInfo.IME_ACTION_UNSPECIFIED
: editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")

View File

@ -1276,10 +1276,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
} }
break; break;
default: default:
if (primaryCode == Keyboard.CODE_TAB && mCurrentSettings.isEditorActionNext()) {
performEditorAction(EditorInfo.IME_ACTION_NEXT);
break;
}
mSpaceState = SPACE_STATE_NONE; mSpaceState = SPACE_STATE_NONE;
if (mCurrentSettings.isWordSeparator(primaryCode)) { if (mCurrentSettings.isWordSeparator(primaryCode)) {
didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState); didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState);

View File

@ -224,10 +224,6 @@ public class SettingsValues {
return mInputAttributes.mApplicationSpecifiedCompletionOn; return mInputAttributes.mApplicationSpecifiedCompletionOn;
} }
public boolean isEditorActionNext() {
return mInputAttributes.mEditorAction == EditorInfo.IME_ACTION_NEXT;
}
public boolean isSuggestionsRequested(final int displayOrientation) { public boolean isSuggestionsRequested(final int displayOrientation) {
return mInputAttributes.mIsSettingsSuggestionStripOn return mInputAttributes.mIsSettingsSuggestionStripOn
&& (mCorrectionEnabled && (mCorrectionEnabled