Rename imeOptions attribute of Keyboard to imeAction.
Bug: 3384942 Change-Id: I3ce01b83f0ae37f447de8a7fcdb5d7fe06b108c6main
parent
aa721c4783
commit
d9c52ba623
|
@ -171,7 +171,7 @@
|
|||
<attr name="hasSettingsKey" format="string" />
|
||||
<attr name="voiceKeyEnabled" format="string" />
|
||||
<attr name="hasVoiceKey" format="string" />
|
||||
<attr name="imeOptions">
|
||||
<attr name="imeAction">
|
||||
<!-- This should be aligned with EditorInfo.IME_ACTION_* -->
|
||||
<flag name="actionUnspecified" value="0" />
|
||||
<flag name="actionNone" value="1" />
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<default>
|
||||
<switch>
|
||||
<case
|
||||
latin:imeOptions="actionSearch"
|
||||
latin:imeAction="actionSearch"
|
||||
>
|
||||
<Key
|
||||
latin:keyLabel=":"
|
||||
|
|
|
@ -182,7 +182,7 @@
|
|||
<!-- Return key style -->
|
||||
<switch>
|
||||
<case
|
||||
latin:imeOptions="actionGo"
|
||||
latin:imeAction="actionGo"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="returnKeyStyle"
|
||||
|
@ -191,7 +191,7 @@
|
|||
latin:parentStyle="functionalKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
latin:imeOptions="actionNext"
|
||||
latin:imeAction="actionNext"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="returnKeyStyle"
|
||||
|
@ -200,7 +200,7 @@
|
|||
latin:parentStyle="functionalKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
latin:imeOptions="actionDone"
|
||||
latin:imeAction="actionDone"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="returnKeyStyle"
|
||||
|
@ -209,7 +209,7 @@
|
|||
latin:parentStyle="functionalKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
latin:imeOptions="actionSend"
|
||||
latin:imeAction="actionSend"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="returnKeyStyle"
|
||||
|
@ -218,7 +218,7 @@
|
|||
latin:parentStyle="functionalKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
latin:imeOptions="actionSearch"
|
||||
latin:imeAction="actionSearch"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
|
|
|
@ -44,7 +44,7 @@ public class KeyboardId {
|
|||
public final boolean mHasSettingsKey;
|
||||
public final boolean mVoiceKeyEnabled;
|
||||
public final boolean mHasVoiceKey;
|
||||
public final int mImeOptions;
|
||||
public final int mImeAction;
|
||||
public final boolean mEnableShiftLock;
|
||||
public final String mXmlName;
|
||||
|
||||
|
@ -61,8 +61,9 @@ public class KeyboardId {
|
|||
this.mHasSettingsKey = hasSettingsKey;
|
||||
this.mVoiceKeyEnabled = voiceKeyEnabled;
|
||||
this.mHasVoiceKey = hasVoiceKey;
|
||||
// We are interested only in IME_MASK_ACTION enum value and IME_FLAG_NO_ENTER_ACTION.
|
||||
this.mImeOptions = imeOptions
|
||||
// We are interested only in {@link EditorInfo#IME_MASK_ACTION} enum value and
|
||||
// {@link EditorInfo#IME_FLAG_NO_ENTER_ACTION}.
|
||||
this.mImeAction = imeOptions
|
||||
& (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
|
||||
this.mEnableShiftLock = enableShiftLock;
|
||||
this.mXmlName = xmlName;
|
||||
|
@ -76,7 +77,7 @@ public class KeyboardId {
|
|||
hasSettingsKey,
|
||||
voiceKeyEnabled,
|
||||
hasVoiceKey,
|
||||
imeOptions,
|
||||
mImeAction,
|
||||
enableShiftLock,
|
||||
});
|
||||
}
|
||||
|
@ -115,7 +116,7 @@ public class KeyboardId {
|
|||
&& other.mHasSettingsKey == this.mHasSettingsKey
|
||||
&& other.mVoiceKeyEnabled == this.mVoiceKeyEnabled
|
||||
&& other.mHasVoiceKey == this.mHasVoiceKey
|
||||
&& other.mImeOptions == this.mImeOptions
|
||||
&& other.mImeAction == this.mImeAction
|
||||
&& other.mEnableShiftLock == this.mEnableShiftLock;
|
||||
}
|
||||
|
||||
|
@ -131,7 +132,7 @@ public class KeyboardId {
|
|||
mLocale,
|
||||
(mOrientation == 1 ? "port" : "land"),
|
||||
modeName(mMode),
|
||||
imeOptionsName(mImeOptions),
|
||||
imeOptionsName(mImeAction),
|
||||
colorSchemeName(mColorScheme),
|
||||
(mHasSettingsKey ? " hasSettingsKey" : ""),
|
||||
(mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),
|
||||
|
|
|
@ -427,13 +427,14 @@ public class KeyboardParser {
|
|||
R.styleable.Keyboard_Case_hasVoiceKey, id.mHasVoiceKey);
|
||||
final boolean colorSchemeMatched = matchInteger(viewAttr,
|
||||
R.styleable.KeyboardView_colorScheme, id.mColorScheme);
|
||||
// As noted at KeyboardSwitcher.KeyboardId class, we are interested only in
|
||||
// enum value masked by IME_MASK_ACTION and IME_FLAG_NO_ENTER_ACTION. So matching
|
||||
// As noted at {@link KeyboardId} class, we are interested only in enum value masked by
|
||||
// {@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.
|
||||
final boolean imeOptionsMatched = matchInteger(a,
|
||||
R.styleable.Keyboard_Case_imeOptions, id.mImeOptions);
|
||||
final boolean imeActionMatched = matchInteger(a,
|
||||
R.styleable.Keyboard_Case_imeAction, id.mImeAction);
|
||||
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,
|
||||
textAttr(KeyboardId.modeName(
|
||||
|
@ -444,7 +445,7 @@ public class KeyboardParser {
|
|||
booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
|
||||
booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"),
|
||||
textAttr(KeyboardId.imeOptionsName(
|
||||
a.getInt(R.styleable.Keyboard_Case_imeOptions, -1)), "imeOptions"),
|
||||
a.getInt(R.styleable.Keyboard_Case_imeAction, -1)), "imeAction"),
|
||||
Boolean.toString(selected)));
|
||||
|
||||
return selected;
|
||||
|
|
Loading…
Reference in New Issue