am 72ee0bdf
: Merge "Refactor keyboard layout unit tests"
* commit '72ee0bdf18891b806159121e2e511a15d9e49eaa': Refactor keyboard layout unit tests
This commit is contained in:
commit
1dee4b62b0
172 changed files with 1203 additions and 987 deletions
|
@ -18,6 +18,7 @@ package com.android.inputmethod.keyboard.layout;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols.RtlSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted.RtlSymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -27,17 +28,15 @@ import java.util.Locale;
|
|||
public final class Arabic extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "arabic";
|
||||
|
||||
public Arabic(final LayoutCustomizer customizer) {
|
||||
super(customizer, ArabicSymbols.class, ArabicSymbolsShifted.class);
|
||||
public Arabic(final Locale locale) {
|
||||
super(new ArabicCustomizer(locale), ArabicSymbols.class, ArabicSymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class ArabicCustomizer extends LayoutCustomizer {
|
||||
public ArabicCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
private static class ArabicCustomizer extends LayoutCustomizer {
|
||||
ArabicCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return ARABIC_ALPHABET_KEY; }
|
||||
|
@ -141,13 +140,12 @@ public final class Arabic extends LayoutBase {
|
|||
ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) {
|
||||
if (isPhone) {
|
||||
return ALPHABET_COMMON;
|
||||
} else {
|
||||
}
|
||||
final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(ALPHABET_COMMON);
|
||||
// U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE
|
||||
builder.insertKeysAtRow(3, 2, "\u0626");
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
ExpectedKey[][] getCommonAlphabetShiftLayout(final boolean isPhone, final int elementId) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -28,15 +29,16 @@ import java.util.Locale;
|
|||
public final class ArmenianPhonetic extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "armenian_phonetic";
|
||||
|
||||
public ArmenianPhonetic(final LayoutCustomizer customizer) {
|
||||
super(customizer, ArmenianSymbols.class, ArmenianSymbolsShifted.class);
|
||||
public ArmenianPhonetic(final Locale locale) {
|
||||
super(new ArmenianPhoneticCustomizer(locale), ArmenianSymbols.class,
|
||||
ArmenianSymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class ArmenianPhoneticCustomizer extends LayoutCustomizer {
|
||||
public ArmenianPhoneticCustomizer(final Locale locale) { super(locale); }
|
||||
private static class ArmenianPhoneticCustomizer extends LayoutCustomizer {
|
||||
ArmenianPhoneticCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public int getNumberOfRows() { return 5; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.EastSlavic.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -25,17 +26,17 @@ import java.util.Locale;
|
|||
public final class Bulgarian extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "bulgarian";
|
||||
|
||||
public Bulgarian(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Bulgarian(final Locale locale) {
|
||||
super(new BulgarianCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class BulgarianCustomizer extends LayoutCustomizer {
|
||||
private static class BulgarianCustomizer extends LayoutCustomizer {
|
||||
private final EastSlavicCustomizer mEastSlavicCustomizer;
|
||||
|
||||
public BulgarianCustomizer(final Locale locale) {
|
||||
BulgarianCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mEastSlavicCustomizer = new EastSlavicCustomizer(locale);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.EastSlavic.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -25,15 +25,15 @@ import java.util.Locale;
|
|||
public final class BulgarianBds extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "bulgarian_bds";
|
||||
|
||||
public BulgarianBds(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public BulgarianBds(final Locale locale) {
|
||||
super(new BulgarianBdsCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class BulgarianBdsCustomizer extends EastSlavicCustomizer {
|
||||
public BulgarianBdsCustomizer(final Locale locale) { super(locale); }
|
||||
private static class BulgarianBdsCustomizer extends EastSlavicCustomizer {
|
||||
BulgarianBdsCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -17,12 +17,10 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey.ExpectedAdditionalMoreKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The Dvorak alphabet keyboard.
|
||||
*/
|
||||
|
@ -36,52 +34,17 @@ public class Dvorak extends LayoutBase {
|
|||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class DvorakCustomizer extends LayoutCustomizer {
|
||||
public DvorakCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? joinKeys(SHIFT_KEY): joinKeys(SHIFT_KEY, key("q"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : joinKeys(key("z"), SHIFT_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
// U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||
return isPhone ? joinKeys(key("q", SETTINGS_KEY))
|
||||
: joinKeys(key("!", joinMoreKeys("\u00A1", SETTINGS_KEY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
final ExpectedAdditionalMoreKey[] punctuationMoreKeys =
|
||||
convertToAdditionalMoreKeys(getPunctuationMoreKeys(isPhone));
|
||||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
return isPhone
|
||||
? joinKeys(key("z", punctuationMoreKeys))
|
||||
: joinKeys(key("?", joinMoreKeys(punctuationMoreKeys, "\u00BF")));
|
||||
}
|
||||
|
||||
private static ExpectedAdditionalMoreKey[] convertToAdditionalMoreKeys(
|
||||
final ExpectedKey ... moreKeys) {
|
||||
final ExpectedAdditionalMoreKey[] additionalMoreKeys =
|
||||
new ExpectedAdditionalMoreKey[moreKeys.length];
|
||||
for (int index = 0; index < moreKeys.length; index++) {
|
||||
additionalMoreKeys[index] = ExpectedAdditionalMoreKey.newInstance(moreKeys[index]);
|
||||
}
|
||||
return additionalMoreKeys;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) {
|
||||
return ALPHABET_COMMON;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the left most key of the first row.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @param elementId the element id of the requesting shifted mode.
|
||||
* @return the left most key of the first row.
|
||||
*/
|
||||
protected ExpectedKey getRow1_1Key(final boolean isPhone, final int elementId) {
|
||||
if (elementId == KeyboardId.ELEMENT_ALPHABET
|
||||
|| elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) {
|
||||
|
@ -90,6 +53,12 @@ public class Dvorak extends LayoutBase {
|
|||
return key("\"", additionalMoreKey("1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the 2nd left key of the first row.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @param elementId the element id of the requesting shifted mode.
|
||||
* @return the 2nd left key of the first row.
|
||||
*/
|
||||
protected ExpectedKey getRow1_2Key(final boolean isPhone, final int elementId) {
|
||||
if (elementId == KeyboardId.ELEMENT_ALPHABET
|
||||
|| elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) {
|
||||
|
@ -98,6 +67,12 @@ public class Dvorak extends LayoutBase {
|
|||
return key("<", additionalMoreKey("2"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the 3rd left key of the first row.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @param elementId the element id of the requesting shifted mode.
|
||||
* @return the 3rd left key of the first row.
|
||||
*/
|
||||
protected ExpectedKey getRow1_3Key(final boolean isPhone, final int elementId) {
|
||||
if (elementId == KeyboardId.ELEMENT_ALPHABET
|
||||
|| elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) {
|
||||
|
|
|
@ -16,11 +16,9 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public final class EastSlavic extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "east_slavic";
|
||||
|
@ -32,26 +30,6 @@ public final class EastSlavic extends LayoutBase {
|
|||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class EastSlavicCustomizer extends LayoutCustomizer {
|
||||
public EastSlavicCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getAlphabetKey() { return EAST_SLAVIC_ALPHABET_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0410: "А" CYRILLIC CAPITAL LETTER A
|
||||
// U+0411: "Б" CYRILLIC CAPITAL LETTER BE
|
||||
// U+0412: "В" CYRILLIC CAPITAL LETTER VE
|
||||
private static final ExpectedKey EAST_SLAVIC_ALPHABET_KEY = key(
|
||||
"\u0410\u0411\u0412", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
||||
|
||||
@Override
|
||||
ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package com.android.inputmethod.keyboard.layout;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols.RtlSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted.RtlSymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -27,17 +28,15 @@ import java.util.Locale;
|
|||
public final class Farsi extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "farsi";
|
||||
|
||||
public Farsi(final LayoutCustomizer customizer) {
|
||||
super(customizer, FarsiSymbols.class, FarsiSymbolsShifted.class);
|
||||
public Farsi(final Locale locale) {
|
||||
super(new FarsiCustomizer(locale), FarsiSymbols.class, FarsiSymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class FarsiCustomizer extends LayoutCustomizer {
|
||||
public FarsiCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
private static class FarsiCustomizer extends LayoutCustomizer {
|
||||
FarsiCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return FARSI_ALPHABET_KEY; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Georgian extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "georgian";
|
||||
|
||||
public Georgian(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Georgian(final Locale locale) {
|
||||
super(new GeorgianCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class GeorgianCustomizer extends LayoutCustomizer {
|
||||
public GeorgianCustomizer(final Locale locale) { super(locale); }
|
||||
private static class GeorgianCustomizer extends LayoutCustomizer {
|
||||
GeorgianCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return GEORGIAN_ALPHABET_KEY; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Greek extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "greek";
|
||||
|
||||
public Greek(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Greek(final Locale locale) {
|
||||
super(new GreekCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class GreekCustomizer extends EuroCustomizer {
|
||||
public GreekCustomizer(final Locale locale) { super(locale); }
|
||||
private static class GreekCustomizer extends EuroCustomizer {
|
||||
GreekCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return GREEK_ALPHABET_KEY; }
|
||||
|
|
|
@ -18,6 +18,7 @@ package com.android.inputmethod.keyboard.layout;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols.RtlSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted.RtlSymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -27,17 +28,15 @@ import java.util.Locale;
|
|||
public final class Hebrew extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "hebrew";
|
||||
|
||||
public Hebrew(final LayoutCustomizer customizer) {
|
||||
super(customizer, HebrewSymbols.class, RtlSymbolsShifted.class);
|
||||
public Hebrew(final Locale locale) {
|
||||
super(new HebrewCustomizer(locale), HebrewSymbols.class, RtlSymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class HebrewCustomizer extends LayoutCustomizer {
|
||||
public HebrewCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
private static class HebrewCustomizer extends LayoutCustomizer {
|
||||
HebrewCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return HEBREW_ALPHABET_KEY; }
|
||||
|
|
|
@ -19,6 +19,7 @@ package com.android.inputmethod.keyboard.layout;
|
|||
import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.*;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ package com.android.inputmethod.keyboard.layout;
|
|||
import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.*;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.HindiCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.tests.HindiCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -31,15 +31,15 @@ import java.util.Locale;
|
|||
public final class HindiCompact extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "hindi_compact";
|
||||
|
||||
public HindiCompact(final LayoutCustomizer customizer) {
|
||||
super(customizer, HindiSymbols.class, SymbolsShifted.class);
|
||||
public HindiCompact(final Locale locale) {
|
||||
super(new HindiCompactCustomizer(locale), HindiSymbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class HindiCompactCustomizer extends HindiCustomizer {
|
||||
public HindiCompactCustomizer(final Locale locale) { super(locale); }
|
||||
private static class HindiCompactCustomizer extends HindiCustomizer {
|
||||
HindiCompactCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -28,15 +29,15 @@ import java.util.Locale;
|
|||
public final class Kannada extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "kannada";
|
||||
|
||||
public Kannada(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Kannada(final Locale locale) {
|
||||
super(new KannadaCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class KannadaCustomizer extends LayoutCustomizer {
|
||||
public KannadaCustomizer(final Locale locale) { super(locale); }
|
||||
private static class KannadaCustomizer extends LayoutCustomizer {
|
||||
KannadaCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return KANNADA_ALPHABET_KEY; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Khmer extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "khmer";
|
||||
|
||||
public Khmer(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Khmer(final Locale locale) {
|
||||
super(new KhmerCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class KhmerCustomizer extends LayoutCustomizer {
|
||||
public KhmerCustomizer(final Locale locale) { super(locale); }
|
||||
private static class KhmerCustomizer extends LayoutCustomizer {
|
||||
KhmerCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public int getNumberOfRows() { return 5; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Lao extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "lao";
|
||||
|
||||
public Lao(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Lao(final Locale locale) {
|
||||
super(new LaoCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class LaoCustomizer extends LayoutCustomizer {
|
||||
public LaoCustomizer(final Locale locale) { super(locale); }
|
||||
private static class LaoCustomizer extends LayoutCustomizer {
|
||||
LaoCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public int getNumberOfRows() { return 5; }
|
||||
|
|
|
@ -17,11 +17,10 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.AbstractLayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -29,218 +28,6 @@ import java.util.Locale;
|
|||
* The base class of keyboard layout.
|
||||
*/
|
||||
public abstract class LayoutBase extends AbstractLayoutBase {
|
||||
/**
|
||||
* This class is used to customize common keyboard layout to language specific layout.
|
||||
*/
|
||||
public static class LayoutCustomizer {
|
||||
private final Locale mLocale;
|
||||
|
||||
// Empty keys definition to remove keys by adding this.
|
||||
protected static final ExpectedKey[] EMPTY_KEYS = joinKeys();
|
||||
|
||||
public LayoutCustomizer(final Locale locale) {
|
||||
mLocale = locale;
|
||||
}
|
||||
|
||||
public final Locale getLocale() {
|
||||
return mLocale;
|
||||
}
|
||||
|
||||
public int getNumberOfRows() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set accented letters to a specific keyboard element.
|
||||
* @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard
|
||||
* layout.
|
||||
* @param elementId the element id of keyboard
|
||||
* @return the {@link ExpectedKeyboardBuilder} object that contains accented letters as
|
||||
* "more keys".
|
||||
*/
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder,
|
||||
final int elementId) {
|
||||
// This method can be overridden by an extended class to provide customized expected
|
||||
// accented letters depending on the shift state of keyboard.
|
||||
// This is a default behavior to call a shift-state-independent
|
||||
// {@link #setAccentedLetters(ExpectedKeyboardBuilder)} implementation, so that
|
||||
// <code>elementId</code> is ignored here.
|
||||
return setAccentedLetters(builder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set accented letters to common layout.
|
||||
* @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard
|
||||
* layout.
|
||||
* @return the {@link ExpectedKeyboardBuilder} object that contains accented letters as
|
||||
* "more keys".
|
||||
*/
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the function key to switch to alphabet layout.
|
||||
* @return the {@link ExpectedKey} of the alphabet key.
|
||||
*/
|
||||
public ExpectedKey getAlphabetKey() { return ALPHABET_KEY; }
|
||||
|
||||
/**
|
||||
* Get the function key to switch to symbols layout.
|
||||
* @return the {@link ExpectedKey} of the symbols key.
|
||||
*/
|
||||
public ExpectedKey getSymbolsKey() { return SYMBOLS_KEY; }
|
||||
|
||||
/**
|
||||
* Get the function key to switch to symbols shift layout.
|
||||
* @param isPhone true if requesting phone's key.
|
||||
* @return the {@link ExpectedKey} of the symbols shift key.
|
||||
*/
|
||||
public ExpectedKey getSymbolsShiftKey(boolean isPhone) {
|
||||
return isPhone ? SYMBOLS_SHIFT_KEY : TABLET_SYMBOLS_SHIFT_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the function key to switch from symbols shift to symbols layout.
|
||||
* @return the {@link ExpectedKey} of the back to symbols key.
|
||||
*/
|
||||
public ExpectedKey getBackToSymbolsKey() { return BACK_TO_SYMBOLS_KEY; }
|
||||
|
||||
/**
|
||||
* Get the currency key.
|
||||
* @return the {@link ExpectedKey} of the currency key.
|
||||
*/
|
||||
public ExpectedKey getCurrencyKey() { return Symbols.CURRENCY_DOLLAR; }
|
||||
|
||||
/**
|
||||
* Get other currencies keys.
|
||||
* @return the array of {@link ExpectedKey} that represents other currency keys.
|
||||
*/
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_THAN_DOLLAR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "more keys" of double quotation mark.
|
||||
* @return the array of {@link ExpectedKey} of more double quotation marks in natural order.
|
||||
*/
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_9LR; }
|
||||
|
||||
/**
|
||||
* Get "more keys" of single quotation mark.
|
||||
* @return the array of {@link ExpectedKey} of more single quotation marks in natural order.
|
||||
*/
|
||||
public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_9LR; }
|
||||
|
||||
/**
|
||||
* Get double angle quotation marks in natural order.
|
||||
* @return the array of {@link ExpectedKey} of double angle quotation marks in natural
|
||||
* order.
|
||||
*/
|
||||
public ExpectedKey[] getDoubleAngleQuoteKeys() { return Symbols.DOUBLE_ANGLE_QUOTES_LR; }
|
||||
|
||||
/**
|
||||
* Get single angle quotation marks in natural order.
|
||||
* @return the array of {@link ExpectedKey} of single angle quotation marks in natural
|
||||
* order.
|
||||
*/
|
||||
public ExpectedKey[] getSingleAngleQuoteKeys() { return Symbols.SINGLE_ANGLE_QUOTES_LR; }
|
||||
|
||||
/**
|
||||
* Get the left shift keys.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at left edge of the
|
||||
* keyboard.
|
||||
*/
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return joinKeys(SHIFT_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the right shift keys.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at right edge of the
|
||||
* keyboard.
|
||||
*/
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : joinKeys(EXCLAMATION_AND_QUESTION_MARKS, SHIFT_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enter key.
|
||||
* @param isPhone true if requesting phone's key.
|
||||
* @return the array of {@link ExpectedKey} that should be placed as an enter key.
|
||||
*/
|
||||
public ExpectedKey getEnterKey(final boolean isPhone) {
|
||||
return isPhone ? key(ENTER_KEY, EMOJI_ACTION_KEY) : ENTER_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the emoji key.
|
||||
* @param isPhone true if requesting phone's key.
|
||||
* @return the array of {@link ExpectedKey} that should be placed as an emoji key.
|
||||
*/
|
||||
public ExpectedKey getEmojiKey(final boolean isPhone) {
|
||||
return EMOJI_NORMAL_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the space keys.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at the center of the
|
||||
* keyboard.
|
||||
*/
|
||||
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
|
||||
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the keys left to the spacebar.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at left of the spacebar.
|
||||
*/
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
// U+002C: "," COMMA
|
||||
return joinKeys(key("\u002C", SETTINGS_KEY));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the keys right to the spacebar.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at right of the spacebar.
|
||||
*/
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
final ExpectedKey periodKey = key(".", getPunctuationMoreKeys(isPhone));
|
||||
return joinKeys(periodKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "more keys" for the punctuation key (usually the period key).
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that are "more keys" of the punctuation key.
|
||||
*/
|
||||
public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
|
||||
return isPhone ? PHONE_PUNCTUATION_MORE_KEYS : TABLET_PUNCTUATION_MORE_KEYS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The layout customize class for countries that use Euro.
|
||||
*/
|
||||
public static class EuroCustomizer extends LayoutCustomizer {
|
||||
public EuroCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getCurrencyKey() { return Symbols.CURRENCY_EURO; }
|
||||
|
||||
@Override
|
||||
public final ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_THAN_EURO;
|
||||
}
|
||||
}
|
||||
|
||||
private final LayoutCustomizer mCustomizer;
|
||||
private final Symbols mSymbols;
|
||||
private final SymbolsShifted mSymbolsShifted;
|
||||
|
@ -276,77 +63,6 @@ public abstract class LayoutBase extends AbstractLayoutBase {
|
|||
*/
|
||||
public final LayoutCustomizer getCustomizer() { return mCustomizer; }
|
||||
|
||||
// Icon ids.
|
||||
private static final int ICON_DELETE = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_DELETE_KEY);
|
||||
private static final int ICON_SPACE = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SPACE_KEY);
|
||||
private static final int ICON_TAB = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_TAB_KEY);
|
||||
private static final int ICON_SHORTCUT = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SHORTCUT_KEY);
|
||||
private static final int ICON_SETTINGS = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SETTINGS_KEY);
|
||||
private static final int ICON_LANGUAGE_SWITCH = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_LANGUAGE_SWITCH_KEY);
|
||||
private static final int ICON_ENTER = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_ENTER_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);
|
||||
private static final int ICON_SHIFT = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SHIFT_KEY);
|
||||
private static final int ICON_SHIFTED_SHIFT = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SHIFT_KEY_SHIFTED);
|
||||
private static final int ICON_ZWNJ = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_ZWNJ_KEY);
|
||||
private static final int ICON_ZWJ = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_ZWJ_KEY);
|
||||
|
||||
// Functional keys.
|
||||
public static final ExpectedKey DELETE_KEY = key(ICON_DELETE, Constants.CODE_DELETE);
|
||||
public static final ExpectedKey TAB_KEY = key(ICON_TAB, Constants.CODE_TAB);
|
||||
public static final ExpectedKey SHORTCUT_KEY = key(ICON_SHORTCUT, Constants.CODE_SHORTCUT);
|
||||
public static final ExpectedKey SETTINGS_KEY = key(ICON_SETTINGS, Constants.CODE_SETTINGS);
|
||||
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_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);
|
||||
static final ExpectedKey CAPSLOCK_MORE_KEY = key(" ", Constants.CODE_CAPSLOCK);
|
||||
public static final ExpectedKey SHIFT_KEY = key(ICON_SHIFT,
|
||||
Constants.CODE_SHIFT, CAPSLOCK_MORE_KEY);
|
||||
public static final ExpectedKey SHIFTED_SHIFT_KEY = key(ICON_SHIFTED_SHIFT,
|
||||
Constants.CODE_SHIFT, CAPSLOCK_MORE_KEY);
|
||||
static final ExpectedKey ALPHABET_KEY = key("ABC", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
static final ExpectedKey SYMBOLS_KEY = key("?123", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
static final ExpectedKey BACK_TO_SYMBOLS_KEY = key("?123", Constants.CODE_SHIFT);
|
||||
static final ExpectedKey SYMBOLS_SHIFT_KEY = key("= \\ <", Constants.CODE_SHIFT);
|
||||
static final ExpectedKey TABLET_SYMBOLS_SHIFT_KEY = key("~ [ <", Constants.CODE_SHIFT);
|
||||
|
||||
// U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
public static final ExpectedKey[] EXCLAMATION_AND_QUESTION_MARKS = joinKeys(
|
||||
key("!", moreKey("\u00A1")), key("?", moreKey("\u00BF")));
|
||||
// U+200C: ZERO WIDTH NON-JOINER
|
||||
// U+200D: ZERO WIDTH JOINER
|
||||
static final ExpectedKey ZWNJ_KEY = key(ICON_ZWNJ, "\u200C");
|
||||
static final ExpectedKey ZWJ_KEY = key(ICON_ZWJ, "\u200D");
|
||||
// Domain key
|
||||
public static final ExpectedKey DOMAIN_KEY =
|
||||
key(".com", joinMoreKeys(".net", ".org", ".gov", ".edu")).preserveCase();
|
||||
|
||||
// Punctuation more keys for phone form factor.
|
||||
public static final ExpectedKey[] PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", "?", "!", "#", ")", "(", "/", ";",
|
||||
"'", "@", ":", "-", "\"", "+", "%", "&");
|
||||
// Punctuation more keys for tablet form factor.
|
||||
public static final ExpectedKey[] TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", "'", "#", ")", "(", "/", ";",
|
||||
"@", ":", "-", "\"", "+", "%", "&");
|
||||
|
||||
/**
|
||||
* Helper method to create alphabet layout adding special function keys.
|
||||
* @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -28,15 +29,15 @@ import java.util.Locale;
|
|||
public final class Malayalam extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "malayalam";
|
||||
|
||||
public Malayalam(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Malayalam(final Locale locale) {
|
||||
super(new MalayalamCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class MalayalamCustomizer extends LayoutCustomizer {
|
||||
public MalayalamCustomizer(final Locale locale) { super(locale); }
|
||||
private static class MalayalamCustomizer extends LayoutCustomizer {
|
||||
MalayalamCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return MALAYALAM_ALPHABET_KEY; }
|
||||
|
|
|
@ -19,9 +19,9 @@ package com.android.inputmethod.keyboard.layout;
|
|||
import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.*;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DevanagariCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.tests.DevanagariCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -31,20 +31,37 @@ import java.util.Locale;
|
|||
public final class Marathi extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "marathi";
|
||||
|
||||
public Marathi(final LayoutCustomizer customizer) {
|
||||
super(customizer, HindiSymbols.class, SymbolsShifted.class);
|
||||
public Marathi(final Locale locale) {
|
||||
super(new MarathiCustomizer(locale), HindiSymbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class MarathiCustomizer extends DevanagariCustomizer {
|
||||
public MarathiCustomizer(final Locale locale) { super(locale); }
|
||||
private static class MarathiCustomizer extends DevanagariCustomizer {
|
||||
MarathiCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_RUPEE; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return EMPTY_KEYS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+20B9: "₹" INDIAN RUPEE SIGN
|
||||
private static final ExpectedKey CURRENCY_RUPEE = key("\u20B9",
|
||||
Symbols.CURRENCY_GENERIC_MORE_KEYS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.EastSlavic.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -25,17 +25,15 @@ import java.util.Locale;
|
|||
public final class Mongolian extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "mongolian";
|
||||
|
||||
public Mongolian(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Mongolian(final Locale locale) {
|
||||
super(new MongolianCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class MongolianMNCustomizer extends EastSlavicCustomizer {
|
||||
public MongolianMNCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
private static class MongolianCustomizer extends EastSlavicCustomizer {
|
||||
MongolianCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_TUGRIK; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Myanmar extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "myanmar";
|
||||
|
||||
public Myanmar(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Myanmar(final Locale locale) {
|
||||
super(new MyanmarCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class MyanmarCustomizer extends LayoutCustomizer {
|
||||
public MyanmarCustomizer(final Locale locale) { super(locale); }
|
||||
private static class MyanmarCustomizer extends LayoutCustomizer {
|
||||
MyanmarCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public int getNumberOfRows() { return 5; }
|
||||
|
|
|
@ -20,9 +20,9 @@ import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.
|
|||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.NepaliCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.tests.DevanagariCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -32,28 +32,20 @@ import java.util.Locale;
|
|||
public final class NepaliRomanized extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "nepali_romanized";
|
||||
|
||||
public NepaliRomanized(final LayoutCustomizer customizer) {
|
||||
super(customizer, HindiSymbols.class, SymbolsShifted.class);
|
||||
public NepaliRomanized(final Locale locale) {
|
||||
super(new NepaliRomanizedCustomizer(locale), HindiSymbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class NepaliRomanizedCustomizer extends DevanagariCustomizer {
|
||||
public NepaliRomanizedCustomizer(final Locale locale) { super(locale); }
|
||||
private static class NepaliRomanizedCustomizer extends NepaliCustomizer {
|
||||
NepaliRomanizedCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_NEPALI; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
|
||||
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN
|
||||
private static final ExpectedKey CURRENCY_NEPALI = key("\u0930\u0941\u002E",
|
||||
Symbols.DOLLAR_SIGN, Symbols.CENT_SIGN, Symbols.EURO_SIGN, Symbols.POUND_SIGN,
|
||||
Symbols.YEN_SIGN, Symbols.PESO_SIGN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.
|
|||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
|
||||
import com.android.inputmethod.keyboard.layout.NepaliRomanized.NepaliRomanizedCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.NepaliCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -32,15 +32,15 @@ import java.util.Locale;
|
|||
public final class NepaliTraditional extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "nepali_traditional";
|
||||
|
||||
public NepaliTraditional(final LayoutCustomizer customizer) {
|
||||
super(customizer, HindiSymbols.class, SymbolsShifted.class);
|
||||
public NepaliTraditional(final Locale locale) {
|
||||
super(new NepaliTraditionalCustomizer(locale), HindiSymbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class NepaliTraditionalCustomizer extends NepaliRomanizedCustomizer {
|
||||
public NepaliTraditionalCustomizer(final Locale locale) { super(locale); }
|
||||
private static class NepaliTraditionalCustomizer extends NepaliCustomizer {
|
||||
NepaliTraditionalCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) { return EMPTY_KEYS; }
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -17,11 +17,10 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The PC QWERTY alphabet keyboard.
|
||||
*/
|
||||
|
@ -35,35 +34,6 @@ public final class PcQwerty extends LayoutBase {
|
|||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return joinKeys(SHIFT_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
return joinKeys(SETTINGS_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
return isPhone
|
||||
? joinKeys(key(ENTER_KEY, EMOJI_ACTION_KEY))
|
||||
: joinKeys(EMOJI_NORMAL_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) {
|
||||
final LayoutCustomizer customizer = getCustomizer();
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Sinhala extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "sinhala";
|
||||
|
||||
public Sinhala(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Sinhala(final Locale locale) {
|
||||
super(new SinhalaCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class SinhalaCustomizer extends LayoutCustomizer {
|
||||
public SinhalaCustomizer(final Locale locale) { super(locale); }
|
||||
private static class SinhalaCustomizer extends LayoutCustomizer {
|
||||
SinhalaCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return SINHALA_ALPHABET_KEY; }
|
||||
|
|
|
@ -16,11 +16,9 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public final class SouthSlavic extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "south_slavic";
|
||||
|
@ -32,26 +30,6 @@ public final class SouthSlavic extends LayoutBase {
|
|||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class SouthSlavicLayoutCustomizer extends LayoutCustomizer {
|
||||
public SouthSlavicLayoutCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getAlphabetKey() { return SOUTH_SLAVIC_ALPHABET_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0410: "А" CYRILLIC CAPITAL LETTER A
|
||||
// U+0411: "Б" CYRILLIC CAPITAL LETTER BE
|
||||
// U+0412: "В" CYRILLIC CAPITAL LETTER VE
|
||||
private static final ExpectedKey SOUTH_SLAVIC_ALPHABET_KEY = key(
|
||||
"\u0410\u0411\u0412", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
||||
|
||||
@Override
|
||||
ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.AbstractLayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
@ -41,13 +41,13 @@ public class Symbols extends AbstractLayoutBase {
|
|||
customizer.getSingleQuoteMoreKeys(), customizer.getSingleAngleQuoteKeys())));
|
||||
if (isPhone) {
|
||||
builder.addKeysOnTheLeftOfRow(3, customizer.getSymbolsShiftKey(isPhone))
|
||||
.addKeysOnTheRightOfRow(3, LayoutBase.DELETE_KEY)
|
||||
.addKeysOnTheRightOfRow(3, DELETE_KEY)
|
||||
.addKeysOnTheLeftOfRow(4, customizer.getAlphabetKey())
|
||||
.addKeysOnTheRightOfRow(4, customizer.getEnterKey(isPhone));
|
||||
} else {
|
||||
// Tablet symbols keyboard has extra two keys at the left edge of the 3rd row.
|
||||
builder.addKeysOnTheLeftOfRow(3, (Object[])joinKeys("\\", "="));
|
||||
builder.addKeysOnTheRightOfRow(1, LayoutBase.DELETE_KEY)
|
||||
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
|
||||
.addKeysOnTheRightOfRow(2, customizer.getEnterKey(isPhone))
|
||||
.addKeysOnTheLeftOfRow(3, customizer.getSymbolsShiftKey(isPhone))
|
||||
.addKeysOnTheRightOfRow(3, customizer.getSymbolsShiftKey(isPhone))
|
||||
|
@ -167,7 +167,7 @@ public class Symbols extends AbstractLayoutBase {
|
|||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
key("?", moreKey("\u00BF")))
|
||||
.setKeysOfRow(4,
|
||||
key(","), key("_"), LayoutBase.SPACE_KEY, key("/"),
|
||||
key(","), key("_"), SPACE_KEY, key("/"),
|
||||
// U+2026: "…" HORIZONTAL ELLIPSIS
|
||||
key(".", moreKey("\u2026")))
|
||||
.build();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.expected.AbstractLayoutBase;
|
||||
|
@ -37,7 +37,7 @@ public class SymbolsShifted extends AbstractLayoutBase {
|
|||
builder.replaceKeyOfLabel(OTHER_CURRENCIES, (Object[])customizer.getOtherCurrencyKeys());
|
||||
if (isPhone) {
|
||||
builder.addKeysOnTheLeftOfRow(3, customizer.getBackToSymbolsKey())
|
||||
.addKeysOnTheRightOfRow(3, LayoutBase.DELETE_KEY)
|
||||
.addKeysOnTheRightOfRow(3, DELETE_KEY)
|
||||
.addKeysOnTheLeftOfRow(4, customizer.getAlphabetKey())
|
||||
.addKeysOnTheRightOfRow(4, customizer.getEnterKey(isPhone));
|
||||
} else {
|
||||
|
@ -45,7 +45,7 @@ public class SymbolsShifted extends AbstractLayoutBase {
|
|||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
// U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||
builder.addKeysOnTheRightOfRow(3, (Object[])joinKeys("\u00A1", "\u00BF"));
|
||||
builder.addKeysOnTheRightOfRow(1, LayoutBase.DELETE_KEY)
|
||||
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
|
||||
.addKeysOnTheRightOfRow(2, customizer.getEnterKey(isPhone))
|
||||
.addKeysOnTheLeftOfRow(3, customizer.getBackToSymbolsKey())
|
||||
.addKeysOnTheRightOfRow(3, customizer.getBackToSymbolsKey())
|
||||
|
@ -122,7 +122,7 @@ public class SymbolsShifted extends AbstractLayoutBase {
|
|||
// U+2264: "≤" LESS-THAN OR EQUAL TO
|
||||
// U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
key("<", joinMoreKeys("\u2039", "\u2264", "\u00AB")),
|
||||
LayoutBase.SPACE_KEY,
|
||||
SPACE_KEY,
|
||||
// U+203A: "›" SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
|
||||
// U+2265: "≥" GREATER-THAN EQUAL TO
|
||||
// U+00BB: "»" RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
|
|
|
@ -16,11 +16,9 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The Tamil keyboard.
|
||||
|
@ -35,29 +33,6 @@ public final class Tamil extends LayoutBase {
|
|||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class TamilCustomizer extends LayoutCustomizer {
|
||||
public TamilCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return TAMIL_ALPHABET_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return EMPTY_KEYS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0BA4: "த" TAMIL LETTER TA
|
||||
// U+0BAE/U+0BBF: "மி" TAMIL LETTER MA/TAMIL VOWEL SIGN I
|
||||
// U+0BB4/U+0BCD: "ழ்" TAMIL LETTER LLLA/TAMIL SIGN VIRAMA
|
||||
private static final ExpectedKey TAMIL_ALPHABET_KEY = key(
|
||||
"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
||||
|
||||
@Override
|
||||
ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { return ALPHABET_COMMON; }
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -28,15 +29,15 @@ import java.util.Locale;
|
|||
public final class Telugu extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "telugu";
|
||||
|
||||
public Telugu(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Telugu(final Locale locale) {
|
||||
super(new TeluguCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class TeluguCustomizer extends LayoutCustomizer {
|
||||
public TeluguCustomizer(final Locale locale) { super(locale); }
|
||||
private static class TeluguCustomizer extends LayoutCustomizer {
|
||||
TeluguCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return TELUGU_ALPHABET_KEY; }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -29,15 +30,15 @@ import java.util.Locale;
|
|||
public final class Thai extends LayoutBase {
|
||||
private static final String LAYOUT_NAME = "thai";
|
||||
|
||||
public Thai(final LayoutCustomizer customizer) {
|
||||
super(customizer, Symbols.class, SymbolsShifted.class);
|
||||
public Thai(final Locale locale) {
|
||||
super(new ThaiCustomizer(locale), Symbols.class, SymbolsShifted.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return LAYOUT_NAME; }
|
||||
|
||||
public static class ThaiCustomizer extends LayoutCustomizer {
|
||||
public ThaiCustomizer(final Locale locale) { super(locale); }
|
||||
private static class ThaiCustomizer extends LayoutCustomizer {
|
||||
ThaiCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public int getNumberOfRows() { return 5; }
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
|
|
@ -14,10 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -37,12 +35,12 @@ public class BengaliCustomizer extends LayoutCustomizer {
|
|||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : LayoutBase.EXCLAMATION_AND_QUESTION_MARKS;
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0995: "क" BENGALI LETTER KA
|
||||
// U+0996: "ख" BENGALI LETTER KHA
|
||||
// U+0997: "ग" BENGALI LETTER GA
|
||||
private static final ExpectedKey BENGALI_ALPHABET_KEY = LayoutBase.key(
|
||||
private static final ExpectedKey BENGALI_ALPHABET_KEY = key(
|
||||
"\u0995\u0996\u0997", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
|
@ -14,17 +14,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class DanishCustomizer extends EuroCustomizer {
|
||||
public class DanishCustomizer extends EuroCustomizer {
|
||||
public DanishCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
|
@ -14,12 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Hindi;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
|
@ -37,34 +33,17 @@ public class DevanagariCustomizer extends LayoutCustomizer {
|
|||
@Override
|
||||
public ExpectedKey getBackToSymbolsKey() { return HINDI_BACK_TO_SYMBOLS_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_RUPEE; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : Hindi.EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0915: "क" DEVANAGARI LETTER KA
|
||||
// U+0916: "ख" DEVANAGARI LETTER KHA
|
||||
// U+0917: "ग" DEVANAGARI LETTER GA
|
||||
private static final ExpectedKey HINDI_ALPHABET_KEY = Hindi.key(
|
||||
private static final ExpectedKey HINDI_ALPHABET_KEY = key(
|
||||
"\u0915\u0916\u0917", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
// U+0967: "१" DEVANAGARI DIGIT ONE
|
||||
// U+0968: "२" DEVANAGARI DIGIT TWO
|
||||
// U+0969: "३" DEVANAGARI DIGIT THREE
|
||||
private static final String HINDI_SYMBOLS_LABEL = "?\u0967\u0968\u0969";
|
||||
private static final ExpectedKey HINDI_SYMBOLS_KEY = Hindi.key(HINDI_SYMBOLS_LABEL,
|
||||
private static final ExpectedKey HINDI_SYMBOLS_KEY = key(HINDI_SYMBOLS_LABEL,
|
||||
Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
private static final ExpectedKey HINDI_BACK_TO_SYMBOLS_KEY = Hindi.key(HINDI_SYMBOLS_LABEL,
|
||||
private static final ExpectedKey HINDI_BACK_TO_SYMBOLS_KEY = key(HINDI_SYMBOLS_LABEL,
|
||||
Constants.CODE_SHIFT);
|
||||
|
||||
// U+20B9: "₹" INDIAN RUPEE SIGN
|
||||
private static final ExpectedKey CURRENCY_RUPEE = Hindi.key("\u20B9",
|
||||
Symbols.CURRENCY_GENERIC_MORE_KEYS);
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class DutchCustomizer extends EuroCustomizer {
|
||||
public DutchCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_L9R; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_L9R; }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
return builder
|
||||
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
|
||||
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
|
||||
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
|
||||
// U+00E6: "æ" LATIN SMALL LETTER AE
|
||||
// U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
|
||||
// U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
|
||||
// U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
|
||||
.setMoreKeysOf("a",
|
||||
"\u00E1", "\u00E4", "\u00E2", "\u00E0", "\u00E6", "\u00E3", "\u00E5",
|
||||
"\u0101")
|
||||
// U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
|
||||
// U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
|
||||
// U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
// U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
|
||||
// U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
|
||||
// U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
|
||||
// U+0113: "ē" LATIN SMALL LETTER E WITH MACRON
|
||||
.setMoreKeysOf("e",
|
||||
"\u00E9", "\u00EB", "\u00EA", "\u00E8", "\u0119", "\u0117", "\u0113")
|
||||
// U+0133: "ij" LATIN SMALL LIGATURE IJ
|
||||
.setMoreKeysOf("y", "\u0133")
|
||||
// U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
|
||||
// U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
|
||||
// U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
// U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
|
||||
// U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
|
||||
.setMoreKeysOf("u", "\u00FA", "\u00FC", "\u00FB", "\u00F9", "\u016B")
|
||||
// U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
|
||||
// U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
|
||||
// U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
|
||||
// U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
// U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
|
||||
// U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
|
||||
// U+0133: "ij" LATIN SMALL LIGATURE IJ
|
||||
.setMoreKeysOf("i",
|
||||
"\u00ED", "\u00EF", "\u00EC", "\u00EE", "\u012F", "\u012B", "\u0133")
|
||||
// U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
|
||||
// U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
|
||||
// U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
// U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
|
||||
// U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
|
||||
// U+0153: "œ" LATIN SMALL LIGATURE OE
|
||||
// U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
|
||||
// U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
|
||||
.setMoreKeysOf("o",
|
||||
"\u00F3", "\u00F6", "\u00F4", "\u00F2", "\u00F5", "\u0153", "\u00F8",
|
||||
"\u014D")
|
||||
// U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
|
||||
// U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE
|
||||
.setMoreKeysOf("n", "\u00F1", "\u0144");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey.ExpectedAdditionalMoreKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class DvorakCustomizer extends LayoutCustomizer {
|
||||
public DvorakCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? joinKeys(SHIFT_KEY): joinKeys(SHIFT_KEY, key("q"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : joinKeys(key("z"), SHIFT_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
// U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||
return isPhone ? joinKeys(key("q", SETTINGS_KEY))
|
||||
: joinKeys(key("!", joinMoreKeys("\u00A1", SETTINGS_KEY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
final ExpectedAdditionalMoreKey[] punctuationMoreKeys =
|
||||
convertToAdditionalMoreKeys(getPunctuationMoreKeys(isPhone));
|
||||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
return isPhone
|
||||
? joinKeys(key("z", punctuationMoreKeys))
|
||||
: joinKeys(key("?", joinMoreKeys(punctuationMoreKeys, "\u00BF")));
|
||||
}
|
||||
|
||||
private static ExpectedAdditionalMoreKey[] convertToAdditionalMoreKeys(
|
||||
final ExpectedKey ... moreKeys) {
|
||||
final ExpectedAdditionalMoreKey[] additionalMoreKeys =
|
||||
new ExpectedAdditionalMoreKey[moreKeys.length];
|
||||
for (int index = 0; index < moreKeys.length; index++) {
|
||||
additionalMoreKeys[index] = ExpectedAdditionalMoreKey.newInstance(moreKeys[index]);
|
||||
}
|
||||
return additionalMoreKeys;
|
||||
}
|
||||
|
||||
public static class EnglishDvorakCustomizer extends DvorakCustomizer {
|
||||
private final EnglishCustomizer mEnglishCustomizer;
|
||||
|
||||
public EnglishDvorakCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mEnglishCustomizer = new EnglishCustomizer(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
return mEnglishCustomizer.setAccentedLetters(builder);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class EastSlavicCustomizer extends LayoutCustomizer {
|
||||
public EastSlavicCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getAlphabetKey() { return EAST_SLAVIC_ALPHABET_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0410: "А" CYRILLIC CAPITAL LETTER A
|
||||
// U+0411: "Б" CYRILLIC CAPITAL LETTER BE
|
||||
// U+0412: "В" CYRILLIC CAPITAL LETTER VE
|
||||
private static final ExpectedKey EAST_SLAVIC_ALPHABET_KEY = key(
|
||||
"\u0410\u0411\u0412", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
|
@ -14,15 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class EnglishCustomizer extends LayoutCustomizer {
|
||||
EnglishCustomizer(final Locale locale) { super(locale); }
|
||||
public class EnglishCustomizer extends LayoutCustomizer {
|
||||
public EnglishCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
|
@ -14,10 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.KeyboardId;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
@ -25,10 +24,8 @@ import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
class EstonianEECustomizer extends EuroCustomizer {
|
||||
public EstonianEECustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
public class EstonianEECustomizer extends EuroCustomizer {
|
||||
public EstonianEECustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; }
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The layout customize class for countries that use Euro.
|
||||
*/
|
||||
public class EuroCustomizer extends LayoutCustomizer {
|
||||
public EuroCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getCurrencyKey() { return Symbols.CURRENCY_EURO; }
|
||||
|
||||
@Override
|
||||
public final ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_THAN_EURO;
|
||||
}
|
||||
}
|
|
@ -14,15 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class FinnishCustomizer extends EuroCustomizer {
|
||||
public class FinnishCustomizer extends EuroCustomizer {
|
||||
public FinnishCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
protected void setNordicKeys(final ExpectedKeyboardBuilder builder) {
|
|
@ -14,15 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class FrenchCustomizer extends LayoutCustomizer {
|
||||
FrenchCustomizer(final Locale locale) { super(locale); }
|
||||
public class FrenchCustomizer extends LayoutCustomizer {
|
||||
public FrenchCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
|
@ -86,4 +86,21 @@ class FrenchCustomizer extends LayoutCustomizer {
|
|||
.setMoreKeysOf("c", "\u00E7", "\u0107", "\u010D")
|
||||
.setAdditionalMoreKeysPositionOf("c", 2);
|
||||
}
|
||||
|
||||
public static final class FrenchEuroCustomizer extends FrenchCustomizer {
|
||||
private final EuroCustomizer mEuroCustomizer;
|
||||
|
||||
public FrenchEuroCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mEuroCustomizer = new EuroCustomizer(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getCurrencyKey() { return mEuroCustomizer.getCurrencyKey(); }
|
||||
|
||||
@Override
|
||||
public final ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return mEuroCustomizer.getOtherCurrencyKeys();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,16 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class GermanCustomizer extends LayoutCustomizer {
|
||||
public class GermanCustomizer extends LayoutCustomizer {
|
||||
public GermanCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
|
@ -86,4 +85,21 @@ class GermanCustomizer extends LayoutCustomizer {
|
|||
// U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE
|
||||
.setMoreKeysOf("n", "\u00F1", "\u0144");
|
||||
}
|
||||
|
||||
public static class GermanEuroCustomizer extends GermanCustomizer {
|
||||
private final EuroCustomizer mEuroCustomizer;
|
||||
|
||||
public GermanEuroCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mEuroCustomizer = new EuroCustomizer(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return mEuroCustomizer.getCurrencyKey(); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return mEuroCustomizer.getOtherCurrencyKeys();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,9 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -24,11 +25,24 @@ import java.util.Locale;
|
|||
public class HindiCustomizer extends DevanagariCustomizer {
|
||||
public HindiCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_RUPEE; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
// U+0964: "।" DEVANAGARI DANDA
|
||||
final ExpectedKey periodKey = LayoutBase.key("\u0964", getPunctuationMoreKeys(isPhone));
|
||||
return LayoutBase.joinKeys(periodKey);
|
||||
final ExpectedKey periodKey = key("\u0964", getPunctuationMoreKeys(isPhone));
|
||||
return joinKeys(periodKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,12 +50,16 @@ public class HindiCustomizer extends DevanagariCustomizer {
|
|||
return isPhone ? HINDI_PHONE_PUNCTUATION_MORE_KEYS : HINDI_TABLET_PUNCTUATION_MORE_KEYS;
|
||||
}
|
||||
|
||||
// U+20B9: "₹" INDIAN RUPEE SIGN
|
||||
private static final ExpectedKey CURRENCY_RUPEE = key("\u20B9",
|
||||
Symbols.CURRENCY_GENERIC_MORE_KEYS);
|
||||
|
||||
// Punctuation more keys for phone form factor.
|
||||
private static final ExpectedKey[] HINDI_PHONE_PUNCTUATION_MORE_KEYS = LayoutBase.joinKeys(
|
||||
private static final ExpectedKey[] HINDI_PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", ".", "?", "!", "#", ")", "(", "/", ";",
|
||||
"'", "@", ":", "-", "\"", "+", "%", "&");
|
||||
// Punctuation more keys for tablet form factor.
|
||||
private static final ExpectedKey[] HINDI_TABLET_PUNCTUATION_MORE_KEYS = LayoutBase.joinKeys(
|
||||
private static final ExpectedKey[] HINDI_TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", ".", "'", "#", ")", "(", "/", ";",
|
||||
"@", ":", "-", "\"", "+", "%", "&");
|
||||
}
|
|
@ -14,14 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class ItalianCustomizer extends LayoutCustomizer {
|
||||
public class ItalianCustomizer extends LayoutCustomizer {
|
||||
public ItalianCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.expected.AbstractLayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* This class is used to customize common keyboard layout to language specific layout.
|
||||
*/
|
||||
public class LayoutCustomizer extends AbstractLayoutBase {
|
||||
private final Locale mLocale;
|
||||
|
||||
// Empty keys definition to remove keys by adding this.
|
||||
protected static final ExpectedKey[] EMPTY_KEYS = joinKeys();
|
||||
|
||||
public LayoutCustomizer(final Locale locale) { mLocale = locale; }
|
||||
|
||||
public final Locale getLocale() { return mLocale; }
|
||||
|
||||
public int getNumberOfRows() { return 4; }
|
||||
|
||||
/**
|
||||
* Set accented letters to a specific keyboard element.
|
||||
* @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard
|
||||
* layout.
|
||||
* @param elementId the element id of keyboard
|
||||
* @return the {@link ExpectedKeyboardBuilder} object that contains accented letters as
|
||||
* "more keys".
|
||||
*/
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder,
|
||||
final int elementId) {
|
||||
// This method can be overridden by an extended class to provide customized expected
|
||||
// accented letters depending on the shift state of keyboard.
|
||||
// This is a default behavior to call a shift-state-independent
|
||||
// {@link #setAccentedLetters(ExpectedKeyboardBuilder)} implementation, so that
|
||||
// <code>elementId</code> is ignored here.
|
||||
return setAccentedLetters(builder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set accented letters to common layout.
|
||||
* @param builder the {@link ExpectedKeyboardBuilder} object that contains common keyboard
|
||||
* layout.
|
||||
* @return the {@link ExpectedKeyboardBuilder} object that contains accented letters as
|
||||
* "more keys".
|
||||
*/
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the function key to switch to alphabet layout.
|
||||
* @return the {@link ExpectedKey} of the alphabet key.
|
||||
*/
|
||||
public ExpectedKey getAlphabetKey() { return ALPHABET_KEY; }
|
||||
|
||||
/**
|
||||
* Get the function key to switch to symbols layout.
|
||||
* @return the {@link ExpectedKey} of the symbols key.
|
||||
*/
|
||||
public ExpectedKey getSymbolsKey() { return SYMBOLS_KEY; }
|
||||
|
||||
/**
|
||||
* Get the function key to switch to symbols shift layout.
|
||||
* @param isPhone true if requesting phone's key.
|
||||
* @return the {@link ExpectedKey} of the symbols shift key.
|
||||
*/
|
||||
public ExpectedKey getSymbolsShiftKey(boolean isPhone) {
|
||||
return isPhone ? SYMBOLS_SHIFT_KEY : TABLET_SYMBOLS_SHIFT_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the function key to switch from symbols shift to symbols layout.
|
||||
* @return the {@link ExpectedKey} of the back to symbols key.
|
||||
*/
|
||||
public ExpectedKey getBackToSymbolsKey() { return BACK_TO_SYMBOLS_KEY; }
|
||||
|
||||
/**
|
||||
* Get the currency key.
|
||||
* @return the {@link ExpectedKey} of the currency key.
|
||||
*/
|
||||
public ExpectedKey getCurrencyKey() { return Symbols.CURRENCY_DOLLAR; }
|
||||
|
||||
/**
|
||||
* Get other currencies keys.
|
||||
* @return the array of {@link ExpectedKey} that represents other currency keys.
|
||||
*/
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_THAN_DOLLAR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "more keys" of double quotation mark.
|
||||
* @return the array of {@link ExpectedKey} of more double quotation marks in natural order.
|
||||
*/
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_9LR; }
|
||||
|
||||
/**
|
||||
* Get "more keys" of single quotation mark.
|
||||
* @return the array of {@link ExpectedKey} of more single quotation marks in natural order.
|
||||
*/
|
||||
public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_9LR; }
|
||||
|
||||
/**
|
||||
* Get double angle quotation marks in natural order.
|
||||
* @return the array of {@link ExpectedKey} of double angle quotation marks in natural
|
||||
* order.
|
||||
*/
|
||||
public ExpectedKey[] getDoubleAngleQuoteKeys() { return Symbols.DOUBLE_ANGLE_QUOTES_LR; }
|
||||
|
||||
/**
|
||||
* Get single angle quotation marks in natural order.
|
||||
* @return the array of {@link ExpectedKey} of single angle quotation marks in natural
|
||||
* order.
|
||||
*/
|
||||
public ExpectedKey[] getSingleAngleQuoteKeys() { return Symbols.SINGLE_ANGLE_QUOTES_LR; }
|
||||
|
||||
/**
|
||||
* Get the left shift keys.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at left edge of the
|
||||
* keyboard.
|
||||
*/
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return joinKeys(SHIFT_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the right shift keys.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at right edge of the
|
||||
* keyboard.
|
||||
*/
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : joinKeys(EXCLAMATION_AND_QUESTION_MARKS, SHIFT_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enter key.
|
||||
* @param isPhone true if requesting phone's key.
|
||||
* @return the array of {@link ExpectedKey} that should be placed as an enter key.
|
||||
*/
|
||||
public ExpectedKey getEnterKey(final boolean isPhone) {
|
||||
return isPhone ? key(ENTER_KEY, EMOJI_ACTION_KEY) : ENTER_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the emoji key.
|
||||
* @param isPhone true if requesting phone's key.
|
||||
* @return the array of {@link ExpectedKey} that should be placed as an emoji key.
|
||||
*/
|
||||
public ExpectedKey getEmojiKey(final boolean isPhone) {
|
||||
return EMOJI_NORMAL_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the space keys.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at the center of the
|
||||
* keyboard.
|
||||
*/
|
||||
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
|
||||
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the keys left to the spacebar.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at left of the spacebar.
|
||||
*/
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
// U+002C: "," COMMA
|
||||
return joinKeys(key("\u002C", SETTINGS_KEY));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the keys right to the spacebar.
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that should be placed at right of the spacebar.
|
||||
*/
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
final ExpectedKey periodKey = key(".", getPunctuationMoreKeys(isPhone));
|
||||
return joinKeys(periodKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "more keys" for the punctuation key (usually the period key).
|
||||
* @param isPhone true if requesting phone's keys.
|
||||
* @return the array of {@link ExpectedKey} that are "more keys" of the punctuation key.
|
||||
*/
|
||||
public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
|
||||
return isPhone ? PHONE_PUNCTUATION_MORE_KEYS : TABLET_PUNCTUATION_MORE_KEYS;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class NepaliCustomizer extends DevanagariCustomizer {
|
||||
public NepaliCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_NEPALI; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
|
||||
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
|
||||
}
|
||||
|
||||
// U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN
|
||||
private static final ExpectedKey CURRENCY_NEPALI = key("\u0930\u0941\u002E",
|
||||
Symbols.DOLLAR_SIGN, Symbols.CENT_SIGN, Symbols.EURO_SIGN, Symbols.POUND_SIGN,
|
||||
Symbols.YEN_SIGN, Symbols.PESO_SIGN);
|
||||
}
|
|
@ -14,15 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class NoLanguageCustomizer extends LayoutCustomizer {
|
||||
NoLanguageCustomizer(final Locale locale) { super(locale); }
|
||||
public class NoLanguageCustomizer extends LayoutCustomizer {
|
||||
public NoLanguageCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
|
@ -14,17 +14,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class NorwegianCustomizer extends LayoutCustomizer {
|
||||
public class NorwegianCustomizer extends LayoutCustomizer {
|
||||
public NorwegianCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return joinKeys(SHIFT_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
return joinKeys(SETTINGS_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
|
||||
return isPhone
|
||||
? joinKeys(key(ENTER_KEY, EMOJI_ACTION_KEY))
|
||||
: joinKeys(EMOJI_NORMAL_KEY);
|
||||
}
|
||||
}
|
|
@ -14,15 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class PortugueseCustomizer extends LayoutCustomizer {
|
||||
PortugueseCustomizer(final Locale locale) { super(locale); }
|
||||
public class PortugueseCustomizer extends LayoutCustomizer {
|
||||
public PortugueseCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
|
@ -14,22 +14,20 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.SerbianQwertz;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class SerbianLatinCustomizer extends LayoutCustomizer {
|
||||
public class SerbianLatinCustomizer extends LayoutCustomizer {
|
||||
public SerbianLatinCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : LayoutBase.EXCLAMATION_AND_QUESTION_MARKS;
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
protected void setSerbianKeys(final ExpectedKeyboardBuilder builder) {
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class SouthSlavicLayoutCustomizer extends LayoutCustomizer {
|
||||
public SouthSlavicLayoutCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getAlphabetKey() { return SOUTH_SLAVIC_ALPHABET_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0410: "А" CYRILLIC CAPITAL LETTER A
|
||||
// U+0411: "Б" CYRILLIC CAPITAL LETTER BE
|
||||
// U+0412: "В" CYRILLIC CAPITAL LETTER VE
|
||||
private static final ExpectedKey SOUTH_SLAVIC_ALPHABET_KEY = key(
|
||||
"\u0410\u0411\u0412", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
|
@ -14,28 +14,24 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Spanish;
|
||||
import com.android.inputmethod.keyboard.layout.expected.AbstractLayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class SpanishCustomizer extends LayoutCustomizer {
|
||||
SpanishCustomizer(final Locale locale) { super(locale); }
|
||||
public class SpanishCustomizer extends LayoutCustomizer {
|
||||
public SpanishCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
|
||||
return isPhone ? PHONE_PUNCTUATION_MORE_KEYS
|
||||
: LayoutBase.TABLET_PUNCTUATION_MORE_KEYS;
|
||||
return isPhone ? SPANISH_PHONE_PUNCTUATION_MORE_KEYS : TABLET_PUNCTUATION_MORE_KEYS;
|
||||
}
|
||||
|
||||
// Punctuation more keys for phone form factor.
|
||||
private static final ExpectedKey[] PHONE_PUNCTUATION_MORE_KEYS = AbstractLayoutBase.joinKeys(
|
||||
private static final ExpectedKey[] SPANISH_PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
// U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
",", "?", "!", "#", ")", "(", "/", ";", "\u00A1",
|
|
@ -14,10 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
@ -25,7 +23,7 @@ import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
class SwedishCustomizer extends LayoutCustomizer {
|
||||
public class SwedishCustomizer extends LayoutCustomizer {
|
||||
private final LayoutCustomizer mEuroCustomizer;
|
||||
|
||||
public SwedishCustomizer(final Locale locale) {
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class TamilCustomizer extends LayoutCustomizer {
|
||||
public TamilCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getAlphabetKey() { return TAMIL_ALPHABET_KEY; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
|
||||
return EMPTY_KEYS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
// U+0BA4: "த" TAMIL LETTER TA
|
||||
// U+0BAE/U+0BBF: "மி" TAMIL LETTER MA/TAMIL VOWEL SIGN I
|
||||
// U+0BB4/U+0BCD: "ழ்" TAMIL LETTER LLLA/TAMIL SIGN VIRAMA
|
||||
private static final ExpectedKey TAMIL_ALPHABET_KEY = key(
|
||||
"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
}
|
|
@ -14,9 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -24,7 +23,7 @@ import java.util.Locale;
|
|||
/**
|
||||
* Turkic languages layout customizer.
|
||||
*/
|
||||
class TurkicCustomizer extends LayoutCustomizer {
|
||||
public class TurkicCustomizer extends LayoutCustomizer {
|
||||
public TurkicCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
|
@ -14,17 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.layout.tests;
|
||||
package com.android.inputmethod.keyboard.layout.customizer;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
class UzbekCustomizer extends TurkicCustomizer {
|
||||
public UzbekCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
public class UzbekCustomizer extends TurkicCustomizer {
|
||||
public UzbekCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
protected void setUzbekKeys(final ExpectedKeyboardBuilder builder) {
|
||||
builder
|
|
@ -16,7 +16,9 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.layout.expected;
|
||||
|
||||
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey.ExpectedAdditionalMoreKey;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
||||
/**
|
||||
* Base class to create an expected keyboard for unit test.
|
||||
|
@ -102,4 +104,75 @@ public abstract class AbstractLayoutBase {
|
|||
public static ExpectedKey[] joinKeys(final Object ... keys) {
|
||||
return ExpectedKeyboardBuilder.joinKeys(keys);
|
||||
}
|
||||
|
||||
// Icon ids.
|
||||
private static final int ICON_DELETE = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_DELETE_KEY);
|
||||
private static final int ICON_SPACE = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SPACE_KEY);
|
||||
private static final int ICON_TAB = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_TAB_KEY);
|
||||
private static final int ICON_SHORTCUT = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SHORTCUT_KEY);
|
||||
private static final int ICON_SETTINGS = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SETTINGS_KEY);
|
||||
private static final int ICON_LANGUAGE_SWITCH = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_LANGUAGE_SWITCH_KEY);
|
||||
private static final int ICON_ENTER = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_ENTER_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);
|
||||
private static final int ICON_SHIFT = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SHIFT_KEY);
|
||||
private static final int ICON_SHIFTED_SHIFT = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_SHIFT_KEY_SHIFTED);
|
||||
private static final int ICON_ZWNJ = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_ZWNJ_KEY);
|
||||
private static final int ICON_ZWJ = KeyboardIconsSet.getIconId(
|
||||
KeyboardIconsSet.NAME_ZWJ_KEY);
|
||||
|
||||
// Functional keys.
|
||||
protected static final ExpectedKey DELETE_KEY = key(ICON_DELETE, Constants.CODE_DELETE);
|
||||
protected static final ExpectedKey TAB_KEY = key(ICON_TAB, Constants.CODE_TAB);
|
||||
protected static final ExpectedKey SHORTCUT_KEY = key(ICON_SHORTCUT, Constants.CODE_SHORTCUT);
|
||||
protected static final ExpectedKey SETTINGS_KEY = key(ICON_SETTINGS, Constants.CODE_SETTINGS);
|
||||
protected static final ExpectedKey LANGUAGE_SWITCH_KEY = key(
|
||||
ICON_LANGUAGE_SWITCH, Constants.CODE_LANGUAGE_SWITCH);
|
||||
protected static final ExpectedKey ENTER_KEY = key(ICON_ENTER, Constants.CODE_ENTER);
|
||||
protected static final ExpectedKey EMOJI_ACTION_KEY = key(ICON_EMOJI_ACTION, Constants.CODE_EMOJI);
|
||||
protected static final ExpectedKey EMOJI_NORMAL_KEY = key(ICON_EMOJI_NORMAL, Constants.CODE_EMOJI);
|
||||
protected static final ExpectedKey SPACE_KEY = key(ICON_SPACE, Constants.CODE_SPACE);
|
||||
protected static final ExpectedKey CAPSLOCK_MORE_KEY = key(" ", Constants.CODE_CAPSLOCK);
|
||||
protected static final ExpectedKey SHIFT_KEY = key(ICON_SHIFT,
|
||||
Constants.CODE_SHIFT, CAPSLOCK_MORE_KEY);
|
||||
protected static final ExpectedKey SHIFTED_SHIFT_KEY = key(ICON_SHIFTED_SHIFT,
|
||||
Constants.CODE_SHIFT, CAPSLOCK_MORE_KEY);
|
||||
protected static final ExpectedKey ALPHABET_KEY = key("ABC", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
protected static final ExpectedKey SYMBOLS_KEY = key("?123", Constants.CODE_SWITCH_ALPHA_SYMBOL);
|
||||
protected static final ExpectedKey BACK_TO_SYMBOLS_KEY = key("?123", Constants.CODE_SHIFT);
|
||||
protected static final ExpectedKey SYMBOLS_SHIFT_KEY = key("= \\ <", Constants.CODE_SHIFT);
|
||||
protected static final ExpectedKey TABLET_SYMBOLS_SHIFT_KEY = key("~ [ <", Constants.CODE_SHIFT);
|
||||
|
||||
// U+00A1: "¡" INVERTED EXCLAMATION MARK
|
||||
// U+00BF: "¿" INVERTED QUESTION MARK
|
||||
protected static final ExpectedKey[] EXCLAMATION_AND_QUESTION_MARKS = joinKeys(
|
||||
key("!", moreKey("\u00A1")), key("?", moreKey("\u00BF")));
|
||||
// U+200C: ZERO WIDTH NON-JOINER
|
||||
// U+200D: ZERO WIDTH JOINER
|
||||
protected static final ExpectedKey ZWNJ_KEY = key(ICON_ZWNJ, "\u200C");
|
||||
protected static final ExpectedKey ZWJ_KEY = key(ICON_ZWJ, "\u200D");
|
||||
// Domain key
|
||||
protected static final ExpectedKey DOMAIN_KEY =
|
||||
key(".com", joinMoreKeys(".net", ".org", ".gov", ".edu")).preserveCase();
|
||||
|
||||
// Punctuation more keys for phone form factor.
|
||||
protected static final ExpectedKey[] PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", "?", "!", "#", ")", "(", "/", ";",
|
||||
"'", "@", ":", "-", "\"", "+", "%", "&");
|
||||
// Punctuation more keys for tablet form factor.
|
||||
protected static final ExpectedKey[] TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", "'", "#", ")", "(", "/", ";",
|
||||
"@", ":", "-", "\"", "+", "%", "&");
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
|
|
@ -19,7 +19,6 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Arabic;
|
||||
import com.android.inputmethod.keyboard.layout.Arabic.ArabicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -30,7 +29,7 @@ import java.util.Locale;
|
|||
@SmallTest
|
||||
public class TestsArabic extends LayoutTestsBase {
|
||||
private static final Locale LOCALE = new Locale("ar");
|
||||
private static final LayoutBase LAYOUT = new Arabic(new ArabicCustomizer(LOCALE));
|
||||
private static final LayoutBase LAYOUT = new Arabic(LOCALE);
|
||||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
|
|
@ -19,7 +19,6 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.ArmenianPhonetic;
|
||||
import com.android.inputmethod.keyboard.layout.ArmenianPhonetic.ArmenianPhoneticCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -30,8 +29,7 @@ import java.util.Locale;
|
|||
@SmallTest
|
||||
public final class TestsArmenianAMPhonetic extends LayoutTestsBase {
|
||||
private static final Locale LOCALE = new Locale("hy", "AM");
|
||||
private static final LayoutBase LAYOUT = new ArmenianPhonetic(
|
||||
new ArmenianPhoneticCustomizer(LOCALE));
|
||||
private static final LayoutBase LAYOUT = new ArmenianPhonetic(LOCALE);
|
||||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.TurkicCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Spanish;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.SpanishCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -39,7 +40,7 @@ public class TestsBasqueES extends LayoutTestsBase {
|
|||
private static class BasqueESCustomizer extends EuroCustomizer {
|
||||
private final SpanishCustomizer mSpanishCustomizer;
|
||||
|
||||
public BasqueESCustomizer(final Locale locale) {
|
||||
BasqueESCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mSpanishCustomizer = new SpanishCustomizer(locale);
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.EastSlavic;
|
||||
import com.android.inputmethod.keyboard.layout.EastSlavic.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EastSlavicCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public final class TestsBelarusianBY extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class BelarusianBYCustomizer extends EastSlavicCustomizer {
|
||||
public BelarusianBYCustomizer(final Locale locale) { super(locale); }
|
||||
BelarusianBYCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() {
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
import com.android.inputmethod.keyboard.layout.BengaliAkkhor;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.BengaliCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -37,11 +38,11 @@ public final class TestsBengaliBD extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class BengaliBDCustomzier extends BengaliCustomizer {
|
||||
public BengaliBDCustomzier(final Locale locale) { super(locale); }
|
||||
BengaliBDCustomzier(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
|
||||
return isPhone ? EMPTY_KEYS : LayoutBase.EXCLAMATION_AND_QUESTION_MARKS;
|
||||
return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
import com.android.inputmethod.keyboard.layout.Bengali;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.BengaliCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -37,7 +38,7 @@ public final class TestsBengaliIN extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class BengaliINCustomzier extends BengaliCustomizer {
|
||||
public BengaliINCustomzier(final Locale locale) { super(locale); }
|
||||
BengaliINCustomzier(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) { return EMPTY_KEYS; }
|
||||
|
|
|
@ -19,7 +19,6 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Bulgarian;
|
||||
import com.android.inputmethod.keyboard.layout.Bulgarian.BulgarianCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -30,7 +29,7 @@ import java.util.Locale;
|
|||
@SmallTest
|
||||
public final class TestsBulgarian extends LayoutTestsBase {
|
||||
private static final Locale LOCALE = new Locale("bg");
|
||||
private static final LayoutBase LAYOUT = new Bulgarian(new BulgarianCustomizer(LOCALE));
|
||||
private static final LayoutBase LAYOUT = new Bulgarian(LOCALE);
|
||||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
|
|
@ -19,7 +19,6 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.BulgarianBds;
|
||||
import com.android.inputmethod.keyboard.layout.BulgarianBds.BulgarianBdsCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -30,7 +29,7 @@ import java.util.Locale;
|
|||
@SmallTest
|
||||
public final class TestsBulgarianBds extends LayoutTestsBase {
|
||||
private static final Locale LOCALE = new Locale("bg");
|
||||
private static final LayoutBase LAYOUT = new BulgarianBds(new BulgarianBdsCustomizer(LOCALE));
|
||||
private static final LayoutBase LAYOUT = new BulgarianBds(LOCALE);
|
||||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Spanish;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -38,20 +38,20 @@ public class TestsCatalan extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class CatalanCustomizer extends EuroCustomizer {
|
||||
public CatalanCustomizer(final Locale locale) { super(locale); }
|
||||
CatalanCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
|
||||
return isPhone ? PHONE_PUNCTUATION_MORE_KEYS
|
||||
: TABLET_PUNCTUATION_MORE_KEYS;
|
||||
return isPhone ? CATALAN_PHONE_PUNCTUATION_MORE_KEYS
|
||||
: CATALAN_TABLET_PUNCTUATION_MORE_KEYS;
|
||||
}
|
||||
|
||||
// U+00B7: "·" MIDDLE DOT
|
||||
private static final ExpectedKey[] PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
private static final ExpectedKey[] CATALAN_PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", "?", "!", "\u00B7", "#", ")", "(", "/", ";",
|
||||
"'", "@", ":", "-", "\"", "+", "%", "&");
|
||||
|
||||
private static final ExpectedKey[] TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
private static final ExpectedKey[] CATALAN_TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
|
||||
",", "'", "\u00B7", "#", ")", "(", "/", ";",
|
||||
"@", ":", "-", "\"", "+", "%", "&");
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Qwertz;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public final class TestsCroatian extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class CroatianCustomizer extends LayoutCustomizer {
|
||||
public CroatianCustomizer(final Locale locale) { super(locale); }
|
||||
CroatianCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_L9R; }
|
||||
|
|
|
@ -19,9 +19,9 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Qwertz;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public final class TestsCzech extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class CzechCustomizer extends LayoutCustomizer {
|
||||
public CzechCustomizer(final Locale locale) { super(locale); }
|
||||
CzechCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; }
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DanishCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwertz;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DanishCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -36,9 +37,7 @@ public final class TestsDanishQwertz extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class DanishQwertyCustomizer extends DanishCustomizer {
|
||||
public DanishQwertyCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
DanishQwertyCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
protected void setNordicKeys(final ExpectedKeyboardBuilder builder) {
|
||||
|
|
|
@ -19,11 +19,8 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DutchCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -37,70 +34,4 @@ public final class TestsDutch extends LayoutTestsBase {
|
|||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
static class DutchCustomizer extends EuroCustomizer {
|
||||
public DutchCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_L9R; }
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_L9R; }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
return builder
|
||||
// U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
|
||||
// U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
|
||||
// U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
// U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
|
||||
// U+00E6: "æ" LATIN SMALL LETTER AE
|
||||
// U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
|
||||
// U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
|
||||
// U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
|
||||
.setMoreKeysOf("a",
|
||||
"\u00E1", "\u00E4", "\u00E2", "\u00E0", "\u00E6", "\u00E3", "\u00E5",
|
||||
"\u0101")
|
||||
// U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
|
||||
// U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
|
||||
// U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
// U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
|
||||
// U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
|
||||
// U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
|
||||
// U+0113: "ē" LATIN SMALL LETTER E WITH MACRON
|
||||
.setMoreKeysOf("e",
|
||||
"\u00E9", "\u00EB", "\u00EA", "\u00E8", "\u0119", "\u0117", "\u0113")
|
||||
// U+0133: "ij" LATIN SMALL LIGATURE IJ
|
||||
.setMoreKeysOf("y", "\u0133")
|
||||
// U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
|
||||
// U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
|
||||
// U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
// U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
|
||||
// U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
|
||||
.setMoreKeysOf("u", "\u00FA", "\u00FC", "\u00FB", "\u00F9", "\u016B")
|
||||
// U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
|
||||
// U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
|
||||
// U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
|
||||
// U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
// U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
|
||||
// U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
|
||||
// U+0133: "ij" LATIN SMALL LIGATURE IJ
|
||||
.setMoreKeysOf("i",
|
||||
"\u00ED", "\u00EF", "\u00EC", "\u00EE", "\u012F", "\u012B", "\u0133")
|
||||
// U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
|
||||
// U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
|
||||
// U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
// U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
|
||||
// U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
|
||||
// U+0153: "œ" LATIN SMALL LIGATURE OE
|
||||
// U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
|
||||
// U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
|
||||
.setMoreKeysOf("o",
|
||||
"\u00F3", "\u00F6", "\u00F4", "\u00F2", "\u00F5", "\u0153", "\u00F8",
|
||||
"\u014D")
|
||||
// U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
|
||||
// U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE
|
||||
.setMoreKeysOf("n", "\u00F1", "\u0144");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.Azerty;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.tests.TestsDutch.DutchCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DutchCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -25,8 +25,9 @@ import com.android.inputmethod.keyboard.KeyboardId;
|
|||
import com.android.inputmethod.keyboard.KeyboardLayoutSet;
|
||||
import com.android.inputmethod.keyboard.layout.Dvorak;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DvorakCustomizer.EnglishDvorakCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.tests.TestsEnglishDvorak.EnglishDvorakCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -60,23 +61,23 @@ public class TestsDvorakEmail extends LayoutTestsBase {
|
|||
|
||||
@Override
|
||||
public ExpectedKey getEnterKey(final boolean isPhone) {
|
||||
return isPhone ? LayoutBase.ENTER_KEY : super.getEnterKey(isPhone);
|
||||
return isPhone ? ENTER_KEY : super.getEnterKey(isPhone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey getEmojiKey(final boolean isPhone) {
|
||||
return LayoutBase.DOMAIN_KEY;
|
||||
return DOMAIN_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
return isPhone ? super.getKeysLeftToSpacebar(isPhone)
|
||||
: joinKeys(key("@", LayoutBase.SETTINGS_KEY));
|
||||
: joinKeys(key("@", SETTINGS_KEY));
|
||||
}
|
||||
}
|
||||
|
||||
private static class DvorakEmail extends Dvorak {
|
||||
public DvorakEmail(final LayoutCustomizer customizer) {
|
||||
DvorakEmail(final LayoutCustomizer customizer) {
|
||||
super(customizer);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,9 @@ import com.android.inputmethod.keyboard.KeyboardId;
|
|||
import com.android.inputmethod.keyboard.KeyboardLayoutSet;
|
||||
import com.android.inputmethod.keyboard.layout.Dvorak;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DvorakCustomizer.EnglishDvorakCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.tests.TestsEnglishDvorak.EnglishDvorakCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -54,31 +55,27 @@ public class TestsDvorakUrl extends LayoutTestsBase {
|
|||
}
|
||||
|
||||
private static class DvorakUrlCustomizer extends EnglishDvorakCustomizer {
|
||||
DvorakUrlCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
DvorakUrlCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getEnterKey(final boolean isPhone) {
|
||||
return isPhone ? LayoutBase.ENTER_KEY : super.getEnterKey(isPhone);
|
||||
return isPhone ? ENTER_KEY : super.getEnterKey(isPhone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey getEmojiKey(final boolean isPhone) {
|
||||
return LayoutBase.DOMAIN_KEY;
|
||||
return DOMAIN_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
|
||||
return isPhone ? super.getKeysLeftToSpacebar(isPhone)
|
||||
: joinKeys(key("/", LayoutBase.SETTINGS_KEY));
|
||||
: joinKeys(key("/", SETTINGS_KEY));
|
||||
}
|
||||
}
|
||||
|
||||
private static class DvorakEmail extends Dvorak {
|
||||
public DvorakEmail(final LayoutCustomizer customizer) {
|
||||
super(customizer);
|
||||
}
|
||||
DvorakEmail(final LayoutCustomizer customizer) { super(customizer); }
|
||||
|
||||
@Override
|
||||
protected ExpectedKey getRow1_1Key(final boolean isPhone, final int elementId) {
|
||||
|
|
|
@ -19,9 +19,8 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.Dvorak;
|
||||
import com.android.inputmethod.keyboard.layout.Dvorak.DvorakCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.DvorakCustomizer.EnglishDvorakCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -35,18 +34,4 @@ public class TestsEnglishDvorak extends LayoutTestsBase {
|
|||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
public static class EnglishDvorakCustomizer extends DvorakCustomizer {
|
||||
private final EnglishCustomizer mEnglishCustomizer;
|
||||
|
||||
EnglishDvorakCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mEnglishCustomizer = new EnglishCustomizer(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
return mEnglishCustomizer.setAccentedLetters(builder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import com.android.inputmethod.keyboard.layout.LayoutBase;
|
|||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.SymbolsShifted;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EnglishCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -38,7 +39,7 @@ public final class TestsEnglishIN extends TestsEnglishUS {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class EnglishINCustomizer extends EnglishCustomizer {
|
||||
public EnglishINCustomizer(final Locale locale) { super(locale); }
|
||||
EnglishINCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_RUPEE; }
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.Symbols;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EnglishCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -37,7 +38,7 @@ public final class TestsEnglishUK extends TestsEnglishUS {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class EnglishUKCustomizer extends EnglishCustomizer {
|
||||
public EnglishUKCustomizer(final Locale locale) { super(locale); }
|
||||
EnglishUKCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKey getCurrencyKey() { return CURRENCY_POUND; }
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EnglishCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.android.inputmethod.keyboard.layout.tests;
|
|||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.Spanish;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -37,7 +37,7 @@ public class TestsEsperanto extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class EsperantoCustomizer extends LayoutCustomizer {
|
||||
public EsperantoCustomizer(final Locale locale) { super(locale); }
|
||||
EsperantoCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EstonianEECustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.EstonianEECustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -36,9 +37,7 @@ public final class TestsEstonianEEQwerty extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class EstonianEEQwertyCustomizer extends EstonianEECustomizer {
|
||||
public EstonianEEQwertyCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
EstonianEEQwertyCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
protected void setNordicKeys(final ExpectedKeyboardBuilder builder) {
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Nordic;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.FinnishCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.FinnishCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -36,9 +37,7 @@ public final class TestsFinnishQwerty extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class FinnishQwertyCustomizer extends FinnishCustomizer {
|
||||
public FinnishQwertyCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
}
|
||||
FinnishQwertyCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
protected void setNordicKeys(final ExpectedKeyboardBuilder builder) {
|
||||
|
|
|
@ -20,8 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.Azerty;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase.EuroCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.FrenchCustomizer.FrenchEuroCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -35,21 +34,4 @@ public final class TestsFrench extends LayoutTestsBase {
|
|||
|
||||
@Override
|
||||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
static final class FrenchEuroCustomizer extends FrenchCustomizer {
|
||||
private final EuroCustomizer mEuroCustomizer;
|
||||
|
||||
public FrenchEuroCustomizer(final Locale locale) {
|
||||
super(locale);
|
||||
mEuroCustomizer = new EuroCustomizer(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ExpectedKey getCurrencyKey() { return mEuroCustomizer.getCurrencyKey(); }
|
||||
|
||||
@Override
|
||||
public final ExpectedKey[] getOtherCurrencyKeys() {
|
||||
return mEuroCustomizer.getOtherCurrencyKeys();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Qwerty;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.FrenchCustomizer;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
|
||||
import com.android.inputmethod.keyboard.layout.LayoutBase;
|
||||
import com.android.inputmethod.keyboard.layout.Swiss;
|
||||
import com.android.inputmethod.keyboard.layout.customizer.FrenchCustomizer;
|
||||
import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -36,7 +37,7 @@ public final class TestsFrenchCH extends LayoutTestsBase {
|
|||
LayoutBase getLayout() { return LAYOUT; }
|
||||
|
||||
private static class FrenchCHCustomizer extends FrenchCustomizer {
|
||||
public FrenchCHCustomizer(final Locale locale) { super(locale); }
|
||||
FrenchCHCustomizer(final Locale locale) { super(locale); }
|
||||
|
||||
@Override
|
||||
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue