diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 3eb27e76b..2f1a209fc 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -389,6 +389,7 @@ + diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index bf2e76a6b..6b06ce77a 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -154,31 +154,30 @@ + + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForLayoutSwitchKeyStyle" /> + latin:parentStyle="baseForToSymbolKeyStyle" /> mKeyboardLayoutSetElementIdToParamsMap = CollectionUtils.newSparseArray(); - public Params() {} } public static void clearKeyboardCache() { @@ -149,7 +149,11 @@ public final class KeyboardLayoutSet { elementParams = mParams.mKeyboardLayoutSetElementIdToParamsMap.get( KeyboardId.ELEMENT_ALPHABET); } - final KeyboardId id = getKeyboardId(keyboardLayoutSetElementId); + // Note: The keyboard for each shift state, and mode are represented as an elementName + // attribute in a keyboard_layout_set XML file. Also each keyboard layout XML resource is + // specified as an elementKeyboard attribute in the file. + // The KeyboardId is an internal key for a Keyboard object. + final KeyboardId id = new KeyboardId(keyboardLayoutSetElementId, mParams); try { return getKeyboard(elementParams, id); } catch (RuntimeException e) { @@ -187,22 +191,6 @@ public final class KeyboardLayoutSet { return keyboard; } - // Note: The keyboard for each locale, shift state, and mode are represented as - // KeyboardLayoutSet element id that is a key in keyboard_set.xml. Also that file specifies - // which XML layout should be used for each keyboard. The KeyboardId is an internal key for - // Keyboard object. - private KeyboardId getKeyboardId(final int keyboardLayoutSetElementId) { - final Params params = mParams; - final boolean isSymbols = (keyboardLayoutSetElementId == KeyboardId.ELEMENT_SYMBOLS - || keyboardLayoutSetElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED); - final boolean hasShortcutKey = params.mVoiceKeyEnabled - && (isSymbols != params.mVoiceKeyOnMain); - return new KeyboardId(keyboardLayoutSetElementId, params.mSubtype, params.mDeviceFormFactor, - params.mOrientation, params.mWidth, params.mMode, params.mEditorInfo, - params.mNoSettingsKey, params.mVoiceKeyEnabled, hasShortcutKey, - params.mLanguageSwitchKeyEnabled); - } - public static final class Builder { private final Context mContext; private final String mPackageName; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java index 36342688e..da418f41a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java @@ -622,6 +622,8 @@ public class KeyboardBuilder { R.styleable.Keyboard_Case_clobberSettingsKey, id.mClobberSettingsKey); final boolean shortcutKeyEnabledMatched = matchBoolean(a, R.styleable.Keyboard_Case_shortcutKeyEnabled, id.mShortcutKeyEnabled); + final boolean shortcutKeyOnSymbolsMatched = matchBoolean(a, + R.styleable.Keyboard_Case_shortcutKeyOnSymbols, id.mShortcutKeyOnSymbols); final boolean hasShortcutKeyMatched = matchBoolean(a, R.styleable.Keyboard_Case_hasShortcutKey, id.mHasShortcutKey); final boolean languageSwitchKeyEnabledMatched = matchBoolean(a, @@ -640,12 +642,12 @@ public class KeyboardBuilder { final boolean selected = keyboardLayoutSetElementMatched && modeMatched && navigateNextMatched && navigatePreviousMatched && passwordInputMatched && clobberSettingsKeyMatched && shortcutKeyEnabledMatched - && hasShortcutKeyMatched && languageSwitchKeyEnabledMatched - && isMultiLineMatched && imeActionMatched && localeCodeMatched - && languageCodeMatched && countryCodeMatched; + && shortcutKeyOnSymbolsMatched && hasShortcutKeyMatched + && languageSwitchKeyEnabledMatched && isMultiLineMatched && imeActionMatched + && localeCodeMatched && languageCodeMatched && countryCodeMatched; if (DEBUG) { - startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE, + startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE, textAttr(a.getString( R.styleable.Keyboard_Case_keyboardLayoutSetElement), "keyboardLayoutSetElement"), @@ -662,6 +664,8 @@ public class KeyboardBuilder { "passwordInput"), booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyEnabled, "shortcutKeyEnabled"), + booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyOnSymbols, + "shortcutKeyOnSymbols"), booleanAttr(a, R.styleable.Keyboard_Case_hasShortcutKey, "hasShortcutKey"), booleanAttr(a, R.styleable.Keyboard_Case_languageSwitchKeyEnabled,