Rename imeOptions attribute of Keyboard to imeAction.

Bug: 3384942
Change-Id: I3ce01b83f0ae37f447de8a7fcdb5d7fe06b108c6
main
Tadashi G. Takaoka 2011-02-18 14:16:29 +09:00
parent aa721c4783
commit d9c52ba623
5 changed files with 21 additions and 19 deletions

View File

@ -171,7 +171,7 @@
<attr name="hasSettingsKey" format="string" /> <attr name="hasSettingsKey" format="string" />
<attr name="voiceKeyEnabled" format="string" /> <attr name="voiceKeyEnabled" format="string" />
<attr name="hasVoiceKey" format="string" /> <attr name="hasVoiceKey" format="string" />
<attr name="imeOptions"> <attr name="imeAction">
<!-- This should be aligned with EditorInfo.IME_ACTION_* --> <!-- This should be aligned with EditorInfo.IME_ACTION_* -->
<flag name="actionUnspecified" value="0" /> <flag name="actionUnspecified" value="0" />
<flag name="actionNone" value="1" /> <flag name="actionNone" value="1" />

View File

@ -49,7 +49,7 @@
<default> <default>
<switch> <switch>
<case <case
latin:imeOptions="actionSearch" latin:imeAction="actionSearch"
> >
<Key <Key
latin:keyLabel=":" latin:keyLabel=":"

View File

@ -182,7 +182,7 @@
<!-- Return key style --> <!-- Return key style -->
<switch> <switch>
<case <case
latin:imeOptions="actionGo" latin:imeAction="actionGo"
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
@ -191,7 +191,7 @@
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
<case <case
latin:imeOptions="actionNext" latin:imeAction="actionNext"
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
@ -200,7 +200,7 @@
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
<case <case
latin:imeOptions="actionDone" latin:imeAction="actionDone"
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
@ -209,7 +209,7 @@
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
<case <case
latin:imeOptions="actionSend" latin:imeAction="actionSend"
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
@ -218,7 +218,7 @@
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
<case <case
latin:imeOptions="actionSearch" latin:imeAction="actionSearch"
> >
<switch> <switch>
<case <case

View File

@ -44,7 +44,7 @@ public class KeyboardId {
public final boolean mHasSettingsKey; public final boolean mHasSettingsKey;
public final boolean mVoiceKeyEnabled; public final boolean mVoiceKeyEnabled;
public final boolean mHasVoiceKey; public final boolean mHasVoiceKey;
public final int mImeOptions; public final int mImeAction;
public final boolean mEnableShiftLock; public final boolean mEnableShiftLock;
public final String mXmlName; public final String mXmlName;
@ -61,8 +61,9 @@ public class KeyboardId {
this.mHasSettingsKey = hasSettingsKey; this.mHasSettingsKey = hasSettingsKey;
this.mVoiceKeyEnabled = voiceKeyEnabled; this.mVoiceKeyEnabled = voiceKeyEnabled;
this.mHasVoiceKey = hasVoiceKey; this.mHasVoiceKey = hasVoiceKey;
// We are interested only in IME_MASK_ACTION enum value and IME_FLAG_NO_ENTER_ACTION. // We are interested only in {@link EditorInfo#IME_MASK_ACTION} enum value and
this.mImeOptions = imeOptions // {@link EditorInfo#IME_FLAG_NO_ENTER_ACTION}.
this.mImeAction = imeOptions
& (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION); & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
this.mEnableShiftLock = enableShiftLock; this.mEnableShiftLock = enableShiftLock;
this.mXmlName = xmlName; this.mXmlName = xmlName;
@ -76,7 +77,7 @@ public class KeyboardId {
hasSettingsKey, hasSettingsKey,
voiceKeyEnabled, voiceKeyEnabled,
hasVoiceKey, hasVoiceKey,
imeOptions, mImeAction,
enableShiftLock, enableShiftLock,
}); });
} }
@ -115,7 +116,7 @@ public class KeyboardId {
&& other.mHasSettingsKey == this.mHasSettingsKey && other.mHasSettingsKey == this.mHasSettingsKey
&& other.mVoiceKeyEnabled == this.mVoiceKeyEnabled && other.mVoiceKeyEnabled == this.mVoiceKeyEnabled
&& other.mHasVoiceKey == this.mHasVoiceKey && other.mHasVoiceKey == this.mHasVoiceKey
&& other.mImeOptions == this.mImeOptions && other.mImeAction == this.mImeAction
&& other.mEnableShiftLock == this.mEnableShiftLock; && other.mEnableShiftLock == this.mEnableShiftLock;
} }
@ -131,7 +132,7 @@ public class KeyboardId {
mLocale, mLocale,
(mOrientation == 1 ? "port" : "land"), (mOrientation == 1 ? "port" : "land"),
modeName(mMode), modeName(mMode),
imeOptionsName(mImeOptions), imeOptionsName(mImeAction),
colorSchemeName(mColorScheme), colorSchemeName(mColorScheme),
(mHasSettingsKey ? " hasSettingsKey" : ""), (mHasSettingsKey ? " hasSettingsKey" : ""),
(mVoiceKeyEnabled ? " voiceKeyEnabled" : ""), (mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),

View File

@ -427,13 +427,14 @@ public class KeyboardParser {
R.styleable.Keyboard_Case_hasVoiceKey, id.mHasVoiceKey); R.styleable.Keyboard_Case_hasVoiceKey, id.mHasVoiceKey);
final boolean colorSchemeMatched = matchInteger(viewAttr, final boolean colorSchemeMatched = matchInteger(viewAttr,
R.styleable.KeyboardView_colorScheme, id.mColorScheme); R.styleable.KeyboardView_colorScheme, id.mColorScheme);
// As noted at KeyboardSwitcher.KeyboardId class, we are interested only in // As noted at {@link KeyboardId} class, we are interested only in enum value masked by
// enum value masked by IME_MASK_ACTION and IME_FLAG_NO_ENTER_ACTION. So matching // {@link android.view.inputmethod.EditorInfo#IME_MASK_ACTION} and
// {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. So matching
// this attribute with id.mImeOptions as integer value is enough for our purpose. // this attribute with id.mImeOptions as integer value is enough for our purpose.
final boolean imeOptionsMatched = matchInteger(a, final boolean imeActionMatched = matchInteger(a,
R.styleable.Keyboard_Case_imeOptions, id.mImeOptions); R.styleable.Keyboard_Case_imeAction, id.mImeAction);
final boolean selected = modeMatched && settingsKeyMatched && voiceEnabledMatched final boolean selected = modeMatched && settingsKeyMatched && voiceEnabledMatched
&& voiceKeyMatched && colorSchemeMatched && imeOptionsMatched; && voiceKeyMatched && colorSchemeMatched && imeActionMatched;
if (DEBUG) Log.d(TAG, String.format("<%s%s%s%s%s%s%s> %s", TAG_CASE, if (DEBUG) Log.d(TAG, String.format("<%s%s%s%s%s%s%s> %s", TAG_CASE,
textAttr(KeyboardId.modeName( textAttr(KeyboardId.modeName(
@ -444,7 +445,7 @@ public class KeyboardParser {
booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"), booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"), booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"),
textAttr(KeyboardId.imeOptionsName( textAttr(KeyboardId.imeOptionsName(
a.getInt(R.styleable.Keyboard_Case_imeOptions, -1)), "imeOptions"), a.getInt(R.styleable.Keyboard_Case_imeAction, -1)), "imeAction"),
Boolean.toString(selected))); Boolean.toString(selected)));
return selected; return selected;