aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-11-21 16:40:38 -0800
committerTadashi G. Takaoka <takaoka@google.com>2010-11-23 18:07:27 -0800
commit59c9930ca98f68aeb6b0b9dc19e29666b8fb152a (patch)
tree38455864d41d3ecacbb43c4f7681d3f5ef612928 /java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
parenta963d0b2e4f1dbe011df383394329d3f95d1d728 (diff)
downloadlatinime-59c9930ca98f68aeb6b0b9dc19e29666b8fb152a.tar.gz
latinime-59c9930ca98f68aeb6b0b9dc19e29666b8fb152a.tar.xz
latinime-59c9930ca98f68aeb6b0b9dc19e29666b8fb152a.zip
Support colorScheme <case/> condition in Keyboard XML
Change-Id: Ibbfb99e0e2b15df301f83af6739b7bca01ebf490
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BaseKeyboardParser.java')
-rw-r--r--java/src/com/android/inputmethod/latin/BaseKeyboardParser.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
index ea209c515..3a2764968 100644
--- a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
+++ b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
@@ -394,18 +394,22 @@ public class BaseKeyboardParser {
final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.BaseKeyboard_Case);
+ final TypedArray viewAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser),
+ R.styleable.BaseKeyboardView);
try {
- final boolean modeMatched = matchInteger(
- a, R.styleable.BaseKeyboard_Case_mode, id.mMode);
- final boolean settingsKeyMatched = matchBoolean(
- a, R.styleable.BaseKeyboard_Case_hasSettingsKey, id.mHasSettingsKey);
- final boolean voiceEnabledMatched = matchBoolean(
- a, R.styleable.BaseKeyboard_Case_voiceKeyEnabled, id.mVoiceKeyEnabled);
- final boolean voiceKeyMatched = matchBoolean(
- a, R.styleable.BaseKeyboard_Case_hasVoiceKey, id.mHasVoiceKey);
+ final boolean modeMatched = matchInteger(a,
+ R.styleable.BaseKeyboard_Case_mode, id.mMode);
+ final boolean settingsKeyMatched = matchBoolean(a,
+ R.styleable.BaseKeyboard_Case_hasSettingsKey, id.mHasSettingsKey);
+ final boolean voiceEnabledMatched = matchBoolean(a,
+ R.styleable.BaseKeyboard_Case_voiceKeyEnabled, id.mVoiceKeyEnabled);
+ final boolean voiceKeyMatched = matchBoolean(a,
+ 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;
+ && voiceEnabledMatched && voiceKeyMatched && colorSchemeMatched;
if (DEBUG_TAG) {
Log.d(TAG, "parseCaseCondition: " + Boolean.toString(selected).toUpperCase()
@@ -417,12 +421,15 @@ public class BaseKeyboardParser {
R.styleable.BaseKeyboard_Case_voiceKeyEnabled, "voiceKeyEnabled")
+ debugBoolean(a,
R.styleable.BaseKeyboard_Case_hasVoiceKey, "hasVoiceKey")
+ + debugInteger(viewAttr,
+ R.styleable.BaseKeyboardView_colorScheme, "colorScheme")
);
}
return selected;
} finally {
a.recycle();
+ viewAttr.recycle();
}
}