diff options
author | 2014-08-13 23:07:59 +0900 | |
---|---|---|
committer | 2014-08-14 00:25:34 +0900 | |
commit | a94c89e017dac92e2c23dcf05a8e6b4000d021d3 (patch) | |
tree | e11e28cfb1723d50b0088436642358264a93bafd | |
parent | d9a8e1ccfd8196adf536e9622c72c1933ebf9a74 (diff) | |
download | latinime-a94c89e017dac92e2c23dcf05a8e6b4000d021d3.tar.gz latinime-a94c89e017dac92e2c23dcf05a8e6b4000d021d3.tar.xz latinime-a94c89e017dac92e2c23dcf05a8e6b4000d021d3.zip |
Use light emoji icon for Material light tablet keyboard
Bug: 16808603
Change-Id: I39ce0ed8b5580754dfd0cf1494289b0a23863d50
25 files changed, 80 insertions, 156 deletions
diff --git a/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_light.png b/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_light.png Binary files differindex 2cfe1d406..b1fe2c0b1 100644 --- a/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_light.png +++ b/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_light.png diff --git a/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_light.png b/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_light.png Binary files differindex ff49d58e1..e639416cd 100644 --- a/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_light.png +++ b/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_light.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_light.png b/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_light.png Binary files differindex df3eba750..0d8c33bcd 100644 --- a/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_light.png +++ b/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_light.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_light.png b/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_light.png Binary files differindex 08d4f8adc..ef5bf5a6f 100644 --- a/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_light.png +++ b/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_light.png diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index bfe385698..e89912a9d 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -242,7 +242,8 @@ <attr name="iconZwnjKey" format="reference" /> <attr name="iconZwjKey" format="reference" /> <attr name="iconImeKey" format="reference" /> - <attr name="iconEmojiKey" format="reference" /> + <attr name="iconEmojiActionKey" format="reference" /> + <attr name="iconEmojiNormalKey" format="reference" /> </declare-styleable> <declare-styleable name="Keyboard_GridRows"> diff --git a/java/res/values/keyboard-icons-holo.xml b/java/res/values/keyboard-icons-holo.xml index d95ff8201..f5484bf4e 100644 --- a/java/res/values/keyboard-icons-holo.xml +++ b/java/res/values/keyboard-icons-holo.xml @@ -35,6 +35,7 @@ <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_dark</item> <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item> <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item> - <item name="iconEmojiKey">@drawable/sym_keyboard_smiley_holo_dark</item> + <item name="iconEmojiActionKey">@drawable/sym_keyboard_smiley_holo_dark</item> + <item name="iconEmojiNormalKey">@drawable/sym_keyboard_smiley_holo_dark</item> </style> </resources> diff --git a/java/res/values/keyboard-icons-lxx-dark.xml b/java/res/values/keyboard-icons-lxx-dark.xml index dfa585c16..305df02cd 100644 --- a/java/res/values/keyboard-icons-lxx-dark.xml +++ b/java/res/values/keyboard-icons-lxx-dark.xml @@ -40,6 +40,7 @@ <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_lxx_dark</item> <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_lxx_dark</item> <item name="iconZwjKey">@drawable/sym_keyboard_zwj_lxx_dark</item> - <item name="iconEmojiKey">@drawable/sym_keyboard_smiley_lxx_dark</item> + <item name="iconEmojiActionKey">@drawable/sym_keyboard_smiley_lxx_dark</item> + <item name="iconEmojiNormalKey">@drawable/sym_keyboard_smiley_lxx_dark</item> </style> </resources> diff --git a/java/res/values/keyboard-icons-lxx-light.xml b/java/res/values/keyboard-icons-lxx-light.xml index e8a3c56cd..866dc682f 100644 --- a/java/res/values/keyboard-icons-lxx-light.xml +++ b/java/res/values/keyboard-icons-lxx-light.xml @@ -40,6 +40,9 @@ <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_lxx_light</item> <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_lxx_light</item> <item name="iconZwjKey">@drawable/sym_keyboard_zwj_lxx_light</item> - <item name="iconEmojiKey">@drawable/sym_keyboard_smiley_lxx_light</item> + <!-- Use white emoji icon (for lxx_dark) because an action key has green/dark color background. --> + <item name="iconEmojiActionKey">@drawable/sym_keyboard_smiley_lxx_dark</item> + <!-- Use dark green emoji icon (for lxx_light) because a normal key has white color background. --> + <item name="iconEmojiNormalKey">@drawable/sym_keyboard_smiley_lxx_light</item> </style> </resources> diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index 877c796c7..1b52b1efd 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -105,7 +105,7 @@ latin:altCode="!code/key_space" /> <key-style latin:styleName="emojiKeyStyle" - latin:keySpec="!icon/emoji_key|!code/key_emoji" + latin:keySpec="!icon/emoji_normal_key|!code/key_emoji" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml-sw600dp/key_styles_enter.xml b/java/res/xml-sw600dp/key_styles_enter.xml index d0167d336..c20523b2a 100644 --- a/java/res/xml-sw600dp/key_styles_enter.xml +++ b/java/res/xml-sw600dp/key_styles_enter.xml @@ -21,7 +21,6 @@ <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > - <!-- TODO: Stop using many conditional cases for keyspec_emoji_key. There are way too many to maintain. --> <!-- Navigate more keys style --> <switch> <!-- latin:passwordInput="true" --> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index bc739f7d0..2d006c992 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -80,7 +80,7 @@ <!-- emojiKeyStyle must be defined before including @xml/key_syles_enter. --> <key-style latin:styleName="emojiKeyStyle" - latin:keySpec="!icon/emoji_key|!code/key_emoji" + latin:keySpec="!icon/emoji_action_key|!code/key_emoji" latin:keyActionFlags="noKeyPreview" latin:backgroundType="action" /> <include diff --git a/java/res/xml/key_styles_enter.xml b/java/res/xml/key_styles_enter.xml index 960c79c18..55dab78c3 100644 --- a/java/res/xml/key_styles_enter.xml +++ b/java/res/xml/key_styles_enter.xml @@ -21,7 +21,7 @@ <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > - <!-- TODO: Stop using many conditional cases for keyspec_emoji_key. There are way too many to maintain. --> + <!-- TODO: Stop using many conditional cases for keyspec_emoji_action_key. There are way too many to maintain. --> <!-- Navigate more keys style --> <switch> <!-- latin:passwordInput="true" --> @@ -182,7 +182,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_key,!text/keyspec_action_previous" /> + latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous" /> </case> <case latin:imeAction="actionNext" @@ -191,7 +191,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!text/keyspec_emoji_key" /> + latin:moreKeys="!text/keyspec_emoji_action_key" /> </case> <case latin:imeAction="actionPrevious" @@ -200,7 +200,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_key,!text/keyspec_action_next" /> + latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_next" /> </case> <case latin:imeAction="actionPrevious" @@ -209,7 +209,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!text/keyspec_emoji_key" /> + latin:moreKeys="!text/keyspec_emoji_action_key" /> </case> <case latin:navigateNext="true" @@ -218,7 +218,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!fixedColumnOrder!3,!needsDividers!,!text/keyspec_emoji_key,!text/keyspec_action_previous,!text/keyspec_action_next" /> + latin:moreKeys="!fixedColumnOrder!3,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous,!text/keyspec_action_next" /> </case> <case latin:navigateNext="true" @@ -227,7 +227,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_key,!text/keyspec_action_next" /> + latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_next" /> </case> <case latin:navigateNext="false" @@ -236,7 +236,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_key,!text/keyspec_action_previous" /> + latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous" /> </case> <case latin:navigateNext="false" @@ -245,7 +245,7 @@ <key-style latin:styleName="navigateMoreKeysStyle" latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="!text/keyspec_emoji_key" /> + latin:moreKeys="!text/keyspec_emoji_action_key" /> </case> <default> <key-style diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java index 09550c4cb..e1f302c1e 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java @@ -53,7 +53,8 @@ public final class KeyboardIconsSet { public static final String NAME_LANGUAGE_SWITCH_KEY = "language_switch_key"; public static final String NAME_ZWNJ_KEY = "zwnj_key"; public static final String NAME_ZWJ_KEY = "zwj_key"; - public static final String NAME_EMOJI_KEY = "emoji_key"; + public static final String NAME_EMOJI_ACTION_KEY = "emoji_action_key"; + public static final String NAME_EMOJI_NORMAL_KEY = "emoji_normal_key"; private static final SparseIntArray ATTR_ID_TO_ICON_ID = new SparseIntArray(); @@ -81,7 +82,8 @@ public final class KeyboardIconsSet { NAME_LANGUAGE_SWITCH_KEY, R.styleable.Keyboard_iconLanguageSwitchKey, NAME_ZWNJ_KEY, R.styleable.Keyboard_iconZwnjKey, NAME_ZWJ_KEY, R.styleable.Keyboard_iconZwjKey, - NAME_EMOJI_KEY, R.styleable.Keyboard_iconEmojiKey, + NAME_EMOJI_ACTION_KEY, R.styleable.Keyboard_iconEmojiActionKey, + NAME_EMOJI_NORMAL_KEY, R.styleable.Keyboard_iconEmojiNormalKey, }; private static int NUM_ICONS = NAMES_AND_ATTR_IDS.length / 2; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java index e6897bf1d..31bc549ca 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -250,7 +250,7 @@ public final class KeyboardTextsTable { /* 164: 0 */ "morekeys_single_quote", /* 165: 0 */ "morekeys_double_quote", /* 166: 0 */ "morekeys_tablet_double_quote", - /* 167: 0 */ "keyspec_emoji_key", + /* 167: 0 */ "keyspec_emoji_action_key", }; private static final String EMPTY = ""; @@ -464,7 +464,7 @@ public final class KeyboardTextsTable { /* morekeys_single_quote */ "!fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes", /* morekeys_double_quote */ "!fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes", /* morekeys_tablet_double_quote */ "!fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes", - /* keyspec_emoji_key */ "!icon/emoji_key|!code/key_emoji", + /* keyspec_emoji_action_key */ "!icon/emoji_action_key|!code/key_emoji", }; /* Locale af: Afrikaans */ diff --git a/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java b/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java index 42ce0c1ea..dba91b4da 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java @@ -39,6 +39,9 @@ public final class ArmenianPhonetic extends LayoutBase { public ArmenianPhoneticCustomizer(final Locale locale) { super(locale); } @Override + public int getNumberOfRows() { return 5; } + + @Override public ExpectedKey getAlphabetKey() { return ARMENIAN_ALPHABET_KEY; } @Override @@ -112,29 +115,6 @@ public final class ArmenianPhonetic extends LayoutBase { return builder.build(); } - // Helper method to create alphabet layout by adding special function keys. - @Override - ExpectedKeyboardBuilder convertCommonLayoutToKeyboard(final ExpectedKeyboardBuilder builder, - final boolean isPhone) { - final LayoutCustomizer customizer = getCustomizer(); - builder.setKeysOfRow(5, (Object[])customizer.getSpaceKeys(isPhone)); - builder.addKeysOnTheLeftOfRow(5, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); - builder.addKeysOnTheRightOfRow(5, (Object[])customizer.getKeysRightToSpacebar(isPhone)); - if (isPhone) { - builder.addKeysOnTheRightOfRow(4, DELETE_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, key(ENTER_KEY, EMOJI_KEY)); - } else { - builder.addKeysOnTheRightOfRow(1, DELETE_KEY) - .addKeysOnTheRightOfRow(3, ENTER_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, EMOJI_KEY); - } - builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) - .addKeysOnTheRightOfRow(4, (Object[])customizer.getRightShiftKeys(isPhone)); - return builder; - } - private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() .setKeysOfRow(1, // U+0567: "է" ARMENIAN SMALL LETTER EH diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java b/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java index 143ccf6eb..7e4f159ab 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java @@ -40,6 +40,9 @@ public final class Khmer extends LayoutBase { public KhmerCustomizer(final Locale locale) { super(locale); } @Override + public int getNumberOfRows() { return 5; } + + @Override public ExpectedKey getAlphabetKey() { return KHMER_ALPHABET_KEY; } @Override @@ -79,29 +82,6 @@ public final class Khmer extends LayoutBase { return ALPHABET_SHIFTED_COMMON; } - // Helper method to create alphabet layout by adding special function keys. - @Override - ExpectedKeyboardBuilder convertCommonLayoutToKeyboard(final ExpectedKeyboardBuilder builder, - final boolean isPhone) { - final LayoutCustomizer customizer = getCustomizer(); - builder.setKeysOfRow(5, (Object[])customizer.getSpaceKeys(isPhone)); - builder.addKeysOnTheLeftOfRow(5, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); - builder.addKeysOnTheRightOfRow(5, (Object[])customizer.getKeysRightToSpacebar(isPhone)); - if (isPhone) { - builder.addKeysOnTheRightOfRow(4, DELETE_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, key(ENTER_KEY, EMOJI_KEY)); - } else { - builder.addKeysOnTheRightOfRow(1, DELETE_KEY) - .addKeysOnTheRightOfRow(3, ENTER_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, EMOJI_KEY); - } - builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) - .addKeysOnTheRightOfRow(4, (Object[])customizer.getRightShiftKeys(isPhone)); - return builder; - } - private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() .setKeysOfRow(1, // U+17E1: "១" KHMER DIGIT ONE diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Lao.java b/tests/src/com/android/inputmethod/keyboard/layout/Lao.java index e7be9982a..aaa1c8a8a 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/Lao.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/Lao.java @@ -40,6 +40,9 @@ public final class Lao extends LayoutBase { public LaoCustomizer(final Locale locale) { super(locale); } @Override + public int getNumberOfRows() { return 5; } + + @Override public ExpectedKey getAlphabetKey() { return LAO_ALPHABET_KEY; } @Override @@ -83,29 +86,6 @@ public final class Lao extends LayoutBase { return ALPHABET_SHIFTED_COMMON; } - // Helper method to create alphabet layout by adding special function keys. - @Override - ExpectedKeyboardBuilder convertCommonLayoutToKeyboard(final ExpectedKeyboardBuilder builder, - final boolean isPhone) { - final LayoutCustomizer customizer = getCustomizer(); - builder.setKeysOfRow(5, (Object[])customizer.getSpaceKeys(isPhone)); - builder.addKeysOnTheLeftOfRow(5, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); - builder.addKeysOnTheRightOfRow(5, (Object[])customizer.getKeysRightToSpacebar(isPhone)); - if (isPhone) { - builder.addKeysOnTheRightOfRow(4, DELETE_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, key(ENTER_KEY, EMOJI_KEY)); - } else { - builder.addKeysOnTheRightOfRow(1, DELETE_KEY) - .addKeysOnTheRightOfRow(3, ENTER_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, EMOJI_KEY); - } - builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) - .addKeysOnTheRightOfRow(4, (Object[])customizer.getRightShiftKeys(isPhone)); - return builder; - } - private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() .setKeysOfRow(1, // U+0EA2: "ຢ" LAO LETTER YO diff --git a/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java b/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java index c5223720c..0548a010d 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java @@ -46,6 +46,10 @@ public abstract class LayoutBase extends AbstractLayoutBase { return mLocale; } + public int getNumberOfRows() { + return 4; + } + /** * Set accented letters to common layout. * @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard @@ -277,7 +281,7 @@ public abstract class LayoutBase extends AbstractLayoutBase { ",", "'", "#", ")", "(", "/", ";", "@", ":", "-", "\"", "+", "%", "&"); - /** + /** * Helper method to create alphabet layout adding special function keys. * @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard * layout @@ -287,21 +291,26 @@ public abstract class LayoutBase extends AbstractLayoutBase { ExpectedKeyboardBuilder convertCommonLayoutToKeyboard(final ExpectedKeyboardBuilder builder, final boolean isPhone) { final LayoutCustomizer customizer = getCustomizer(); - builder.setKeysOfRow(4, (Object[])customizer.getSpaceKeys(isPhone)); - builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); - builder.addKeysOnTheRightOfRow(4, (Object[])customizer.getKeysRightToSpacebar(isPhone)); + final int numberOfRows = customizer.getNumberOfRows(); + builder.setKeysOfRow(numberOfRows, (Object[])customizer.getSpaceKeys(isPhone)); + builder.addKeysOnTheLeftOfRow( + numberOfRows, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); + builder.addKeysOnTheRightOfRow( + numberOfRows, (Object[])customizer.getKeysRightToSpacebar(isPhone)); if (isPhone) { - builder.addKeysOnTheRightOfRow(3, DELETE_KEY) - .addKeysOnTheLeftOfRow(4, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(4, key(ENTER_KEY, EMOJI_KEY)); + builder.addKeysOnTheRightOfRow(numberOfRows - 1, DELETE_KEY) + .addKeysOnTheLeftOfRow(numberOfRows, customizer.getSymbolsKey()) + .addKeysOnTheRightOfRow(numberOfRows, key(ENTER_KEY, EMOJI_ACTION_KEY)); } else { builder.addKeysOnTheRightOfRow(1, DELETE_KEY) - .addKeysOnTheRightOfRow(2, ENTER_KEY) - .addKeysOnTheLeftOfRow(4, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(4, EMOJI_KEY); + .addKeysOnTheRightOfRow(numberOfRows - 2, ENTER_KEY) + .addKeysOnTheLeftOfRow(numberOfRows, customizer.getSymbolsKey()) + .addKeysOnTheRightOfRow(numberOfRows, EMOJI_NORMAL_KEY); } - builder.addKeysOnTheLeftOfRow(3, (Object[])customizer.getLeftShiftKeys(isPhone)) - .addKeysOnTheRightOfRow(3, (Object[])customizer.getRightShiftKeys(isPhone)); + builder.addKeysOnTheLeftOfRow( + numberOfRows - 1, (Object[])customizer.getLeftShiftKeys(isPhone)); + builder.addKeysOnTheRightOfRow( + numberOfRows - 1, (Object[])customizer.getRightShiftKeys(isPhone)); return builder; } diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java b/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java index f2a2dfdd8..15c74ed8c 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java @@ -40,6 +40,9 @@ public final class Myanmar extends LayoutBase { public MyanmarCustomizer(final Locale locale) { super(locale); } @Override + public int getNumberOfRows() { return 5; } + + @Override public ExpectedKey getAlphabetKey() { return MYANMAR_ALPHABET_KEY; } @Override @@ -97,29 +100,6 @@ public final class Myanmar extends LayoutBase { return ALPHABET_SHIFTED_COMMON; } - // Helper method to create alphabet layout by adding special function keys. - @Override - ExpectedKeyboardBuilder convertCommonLayoutToKeyboard(final ExpectedKeyboardBuilder builder, - final boolean isPhone) { - final LayoutCustomizer customizer = getCustomizer(); - builder.setKeysOfRow(5, (Object[])customizer.getSpaceKeys(isPhone)); - builder.addKeysOnTheLeftOfRow(5, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); - builder.addKeysOnTheRightOfRow(5, (Object[])customizer.getKeysRightToSpacebar(isPhone)); - if (isPhone) { - builder.addKeysOnTheRightOfRow(4, DELETE_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, key(ENTER_KEY, EMOJI_KEY)); - } else { - builder.addKeysOnTheRightOfRow(1, DELETE_KEY) - .addKeysOnTheRightOfRow(3, ENTER_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, EMOJI_KEY); - } - builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) - .addKeysOnTheRightOfRow(4, (Object[])customizer.getRightShiftKeys(isPhone)); - return builder; - } - private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() .setKeysOfRow(1, // U+1041: "၁" MYANMAR DIGIT ONE diff --git a/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java b/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java index 9da6dcc44..3f7340fd0 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java @@ -39,6 +39,9 @@ public final class PcQwerty extends LayoutBase { public PcQwertyCustomizer(final Locale locale) { super(locale); } @Override + public int getNumberOfRows() { return 5; } + + @Override public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) { return joinKeys(SHIFT_KEY); } @@ -55,7 +58,9 @@ public final class PcQwerty extends LayoutBase { @Override public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) { - return isPhone ? joinKeys(key(ENTER_KEY, EMOJI_KEY)) : joinKeys(EMOJI_KEY); + return isPhone + ? joinKeys(key(ENTER_KEY, EMOJI_ACTION_KEY)) + : joinKeys(EMOJI_NORMAL_KEY); } } diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Symbols.java b/tests/src/com/android/inputmethod/keyboard/layout/Symbols.java index 5f3e4b196..2cee2d909 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/Symbols.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/Symbols.java @@ -43,7 +43,7 @@ public class Symbols extends AbstractLayoutBase { builder.addKeysOnTheLeftOfRow(3, customizer.getSymbolsShiftKey(isPhone)) .addKeysOnTheRightOfRow(3, DELETE_KEY) .addKeysOnTheLeftOfRow(4, customizer.getAlphabetKey()) - .addKeysOnTheRightOfRow(4, key(ENTER_KEY, EMOJI_KEY)); + .addKeysOnTheRightOfRow(4, key(ENTER_KEY, EMOJI_ACTION_KEY)); } else { // Tablet symbols keyboard has extra two keys at the left edge of the 3rd row. builder.addKeysOnTheLeftOfRow(3, (Object[])joinKeys("\\", "=")); @@ -52,7 +52,7 @@ public class Symbols extends AbstractLayoutBase { .addKeysOnTheLeftOfRow(3, customizer.getSymbolsShiftKey(isPhone)) .addKeysOnTheRightOfRow(3, customizer.getSymbolsShiftKey(isPhone)) .addKeysOnTheLeftOfRow(4, customizer.getAlphabetKey()) - .addKeysOnTheRightOfRow(4, EMOJI_KEY); + .addKeysOnTheRightOfRow(4, EMOJI_NORMAL_KEY); } return builder.build(); } diff --git a/tests/src/com/android/inputmethod/keyboard/layout/SymbolsShifted.java b/tests/src/com/android/inputmethod/keyboard/layout/SymbolsShifted.java index 3265e10e1..7ed103ba0 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/SymbolsShifted.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/SymbolsShifted.java @@ -39,7 +39,7 @@ public class SymbolsShifted extends AbstractLayoutBase { builder.addKeysOnTheLeftOfRow(3, customizer.getBackToSymbolsKey()) .addKeysOnTheRightOfRow(3, DELETE_KEY) .addKeysOnTheLeftOfRow(4, customizer.getAlphabetKey()) - .addKeysOnTheRightOfRow(4, key(ENTER_KEY, EMOJI_KEY)); + .addKeysOnTheRightOfRow(4, key(ENTER_KEY, EMOJI_ACTION_KEY)); } else { // Tablet symbols shifted keyboard has extra two keys at the right edge of the 3rd row. // U+00BF: "¿" INVERTED QUESTION MARK @@ -50,7 +50,7 @@ public class SymbolsShifted extends AbstractLayoutBase { .addKeysOnTheLeftOfRow(3, customizer.getBackToSymbolsKey()) .addKeysOnTheRightOfRow(3, customizer.getBackToSymbolsKey()) .addKeysOnTheLeftOfRow(4, customizer.getAlphabetKey()) - .addKeysOnTheRightOfRow(4, EMOJI_KEY); + .addKeysOnTheRightOfRow(4, EMOJI_NORMAL_KEY); } return builder.build(); } diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Thai.java b/tests/src/com/android/inputmethod/keyboard/layout/Thai.java index af4abea93..cfda2947c 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/Thai.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/Thai.java @@ -40,6 +40,9 @@ public final class Thai extends LayoutBase { public ThaiCustomizer(final Locale locale) { super(locale); } @Override + public int getNumberOfRows() { return 5; } + + @Override public ExpectedKey getAlphabetKey() { return THAI_ALPHABET_KEY; } @Override @@ -96,29 +99,6 @@ public final class Thai extends LayoutBase { return builder.build(); } - // Helper method to create alphabet layout by adding special function keys. - @Override - ExpectedKeyboardBuilder convertCommonLayoutToKeyboard(final ExpectedKeyboardBuilder builder, - final boolean isPhone) { - final LayoutCustomizer customizer = getCustomizer(); - builder.setKeysOfRow(5, (Object[])customizer.getSpaceKeys(isPhone)); - builder.addKeysOnTheLeftOfRow(5, (Object[])customizer.getKeysLeftToSpacebar(isPhone)); - builder.addKeysOnTheRightOfRow(5, (Object[])customizer.getKeysRightToSpacebar(isPhone)); - if (isPhone) { - builder.addKeysOnTheRightOfRow(4, DELETE_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, key(ENTER_KEY, EMOJI_KEY)); - } else { - builder.addKeysOnTheRightOfRow(1, DELETE_KEY) - .addKeysOnTheRightOfRow(3, ENTER_KEY) - .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey()) - .addKeysOnTheRightOfRow(5, EMOJI_KEY); - } - builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) - .addKeysOnTheRightOfRow(4, (Object[])customizer.getRightShiftKeys(isPhone)); - return builder; - } - private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() .setKeysOfRow(1, // U+0E45: "ๅ" THAI CHARACTER LAKKHANGYAO diff --git a/tests/src/com/android/inputmethod/keyboard/layout/expected/AbstractLayoutBase.java b/tests/src/com/android/inputmethod/keyboard/layout/expected/AbstractLayoutBase.java index 9e0039d84..0f7bef2a3 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/expected/AbstractLayoutBase.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/expected/AbstractLayoutBase.java @@ -120,8 +120,10 @@ public abstract class AbstractLayoutBase { KeyboardIconsSet.NAME_LANGUAGE_SWITCH_KEY); private static final int ICON_ENTER = KeyboardIconsSet.getIconId( KeyboardIconsSet.NAME_ENTER_KEY); - private static final int ICON_EMOJI = KeyboardIconsSet.getIconId( - KeyboardIconsSet.NAME_EMOJI_KEY); + private static final int ICON_EMOJI_ACTION = KeyboardIconsSet.getIconId( + KeyboardIconsSet.NAME_EMOJI_ACTION_KEY); + private static final int ICON_EMOJI_NORMAL = KeyboardIconsSet.getIconId( + KeyboardIconsSet.NAME_EMOJI_NORMAL_KEY); // Functional keys. public static final ExpectedKey DELETE_KEY = key(ICON_DELETE, Constants.CODE_DELETE); @@ -131,6 +133,7 @@ public abstract class AbstractLayoutBase { public static final ExpectedKey LANGUAGE_SWITCH_KEY = key( ICON_LANGUAGE_SWITCH, Constants.CODE_LANGUAGE_SWITCH); public static final ExpectedKey ENTER_KEY = key(ICON_ENTER, Constants.CODE_ENTER); - public static final ExpectedKey EMOJI_KEY = key(ICON_EMOJI, Constants.CODE_EMOJI); + public static final ExpectedKey EMOJI_ACTION_KEY = key(ICON_EMOJI_ACTION, Constants.CODE_EMOJI); + public static final ExpectedKey EMOJI_NORMAL_KEY = key(ICON_EMOJI_NORMAL, Constants.CODE_EMOJI); public static final ExpectedKey SPACE_KEY = key(ICON_SPACE, Constants.CODE_SPACE); } diff --git a/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml index bf97e73f4..c4a1b889e 100644 --- a/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml @@ -258,5 +258,5 @@ <string name="morekeys_single_quote">!fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes</string> <string name="morekeys_double_quote">!fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes</string> <string name="morekeys_tablet_double_quote">!fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes</string> - <string name="keyspec_emoji_key">!icon/emoji_key|!code/key_emoji</string> + <string name="keyspec_emoji_action_key">!icon/emoji_action_key|!code/key_emoji</string> </resources> |