aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java26
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Khmer.java26
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Lao.java26
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java33
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java26
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java7
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Symbols.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/SymbolsShifted.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Thai.java26
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/expected/AbstractLayoutBase.java9
10 files changed, 52 insertions, 135 deletions
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);
}