aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-11-19 16:04:52 -0800
committerTadashi G. Takaoka <takaoka@google.com>2010-11-23 23:13:39 -0800
commit6624fd873681160295fe4475aff54512ca905b98 (patch)
treebbd451ca795369d123a4cfc95cc7e4bec9fc9e07 /java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
parent59c9930ca98f68aeb6b0b9dc19e29666b8fb152a (diff)
downloadlatinime-6624fd873681160295fe4475aff54512ca905b98.tar.gz
latinime-6624fd873681160295fe4475aff54512ca905b98.tar.xz
latinime-6624fd873681160295fe4475aff54512ca905b98.zip
Support imeOptions condition in <case>
Change-Id: Ie5494601efb29cf65363c4aa3bf5a9ab04a0109a
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BaseKeyboardParser.java')
-rw-r--r--java/src/com/android/inputmethod/latin/BaseKeyboardParser.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
index 3a2764968..621e875bf 100644
--- a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
+++ b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
@@ -407,23 +407,27 @@ public class BaseKeyboardParser {
R.styleable.BaseKeyboard_Case_hasVoiceKey, id.mHasVoiceKey);
final boolean colorSchemeMatched = matchInteger(viewAttr,
R.styleable.BaseKeyboardView_colorScheme, id.mColorScheme);
-
- final boolean selected = modeMatched && settingsKeyMatched
- && voiceEnabledMatched && voiceKeyMatched && colorSchemeMatched;
+ // 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
+ // this attribute with id.mImeOptions as integer value is enough for our purpose.
+ final boolean imeOptionsMatched = matchInteger(a,
+ R.styleable.BaseKeyboard_Case_imeOptions, id.mImeOptions);
+ final boolean selected = modeMatched && settingsKeyMatched && voiceEnabledMatched
+ && voiceKeyMatched && colorSchemeMatched && imeOptionsMatched;
if (DEBUG_TAG) {
- Log.d(TAG, "parseCaseCondition: " + Boolean.toString(selected).toUpperCase()
- + debugInteger(a,
- R.styleable.BaseKeyboard_Case_mode, "mode")
- + debugBoolean(a,
- R.styleable.BaseKeyboard_Case_hasSettingsKey, "hasSettingsKey")
- + debugBoolean(a,
- R.styleable.BaseKeyboard_Case_voiceKeyEnabled, "voiceKeyEnabled")
- + debugBoolean(a,
- R.styleable.BaseKeyboard_Case_hasVoiceKey, "hasVoiceKey")
- + debugInteger(viewAttr,
- R.styleable.BaseKeyboardView_colorScheme, "colorScheme")
- );
+ Log.d(TAG, String.format(
+ "parseCaseCondition: %s%s%s%s%s%s%s",
+ Boolean.toString(selected).toUpperCase(),
+ debugInteger(a, R.styleable.BaseKeyboard_Case_mode, "mode"),
+ debugBoolean(a, R.styleable.BaseKeyboard_Case_hasSettingsKey,
+ "hasSettingsKey"),
+ debugBoolean(a, R.styleable.BaseKeyboard_Case_voiceKeyEnabled,
+ "voiceKeyEnabled"),
+ debugBoolean(a, R.styleable.BaseKeyboard_Case_hasVoiceKey, "hasVoiceKey"),
+ debugInteger(viewAttr, R.styleable.BaseKeyboardView_colorScheme,
+ "colorScheme"),
+ debugInteger(a, R.styleable.BaseKeyboard_Case_imeOptions, "imeOptions")));
}
return selected;