From 59c9930ca98f68aeb6b0b9dc19e29666b8fb152a Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Sun, 21 Nov 2010 16:40:38 -0800 Subject: Support colorScheme condition in Keyboard XML Change-Id: Ibbfb99e0e2b15df301f83af6739b7bca01ebf490 --- .../inputmethod/latin/BaseKeyboardParser.java | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/BaseKeyboardParser.java') 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(); } } -- cgit v1.2.3-83-g751a