am a94c89e0: Use light emoji icon for Material light tablet keyboard

* commit 'a94c89e017dac92e2c23dcf05a8e6b4000d021d3':
  Use light emoji icon for Material light tablet keyboard
main
Tadashi G. Takaoka 2014-08-13 15:51:07 +00:00 committed by Android Git Automerger
commit 1901c33128
25 changed files with 80 additions and 156 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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">

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -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" -->

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -38,6 +38,9 @@ public final class ArmenianPhonetic extends LayoutBase {
public static class ArmenianPhoneticCustomizer extends LayoutCustomizer {
public ArmenianPhoneticCustomizer(final Locale locale) { super(locale); }
@Override
public int getNumberOfRows() { return 5; }
@Override
public ExpectedKey getAlphabetKey() { return ARMENIAN_ALPHABET_KEY; }
@ -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

View File

@ -39,6 +39,9 @@ public final class Khmer extends LayoutBase {
public static class KhmerCustomizer extends LayoutCustomizer {
public KhmerCustomizer(final Locale locale) { super(locale); }
@Override
public int getNumberOfRows() { return 5; }
@Override
public ExpectedKey getAlphabetKey() { return KHMER_ALPHABET_KEY; }
@ -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

View File

@ -39,6 +39,9 @@ public final class Lao extends LayoutBase {
public static class LaoCustomizer extends LayoutCustomizer {
public LaoCustomizer(final Locale locale) { super(locale); }
@Override
public int getNumberOfRows() { return 5; }
@Override
public ExpectedKey getAlphabetKey() { return LAO_ALPHABET_KEY; }
@ -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

View File

@ -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
@ -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;
}

View File

@ -39,6 +39,9 @@ public final class Myanmar extends LayoutBase {
public static class MyanmarCustomizer extends LayoutCustomizer {
public MyanmarCustomizer(final Locale locale) { super(locale); }
@Override
public int getNumberOfRows() { return 5; }
@Override
public ExpectedKey getAlphabetKey() { return MYANMAR_ALPHABET_KEY; }
@ -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

View File

@ -38,6 +38,9 @@ public final class PcQwerty extends LayoutBase {
public static class PcQwertyCustomizer extends LayoutCustomizer {
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);
}
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -39,6 +39,9 @@ public final class Thai extends LayoutBase {
public static class ThaiCustomizer extends LayoutCustomizer {
public ThaiCustomizer(final Locale locale) { super(locale); }
@Override
public int getNumberOfRows() { return 5; }
@Override
public ExpectedKey getAlphabetKey() { return THAI_ALPHABET_KEY; }
@ -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

View File

@ -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);
}

View File

@ -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>