1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.inputmethod.keyboard.layout.tests; 18 19 import android.test.suitebuilder.annotation.SmallTest; 20 21 import com.android.inputmethod.keyboard.layout.EastSlavic; 22 import com.android.inputmethod.keyboard.layout.EastSlavic.EastSlavicCustomizer; 23 import com.android.inputmethod.keyboard.layout.LayoutBase; 24 import com.android.inputmethod.keyboard.layout.Symbols; 25 import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; 26 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; 27 28 import java.util.Locale; 29 30 /** 31 * be_BY: Belarusian (Belarus)/east_slavic 32 */ 33 @SmallTest 34 public final class TestsBelarusianBY extends LayoutTestsBase { 35 private static final Locale LOCALE = new Locale("be", "BY"); 36 private static final LayoutBase LAYOUT = new EastSlavic(new BelarusianBYCustomizer(LOCALE)); 37 38 @Override 39 LayoutBase getLayout() { return LAYOUT; } 40 41 private static class BelarusianBYCustomizer extends EastSlavicCustomizer { 42 public BelarusianBYCustomizer(final Locale locale) { super(locale); } 43 44 @Override 45 public ExpectedKey[] getDoubleQuoteMoreKeys() { 46 return Symbols.DOUBLE_QUOTES_R9L; 47 } 48 49 @Override 50 public ExpectedKey[] getSingleQuoteMoreKeys() { 51 return Symbols.SINGLE_QUOTES_R9L; 52 } 53 54 @Override 55 public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) { 56 return builder 57 // U+0435: "" CYRILLIC SMALL LETTER IE 58 // U+0451: "" CYRILLIC SMALL LETTER IO 59 .setMoreKeysOf("\u0435", "\u0451") 60 // U+045E: "" CYRILLIC SMALL LETTER SHORT U 61 .replaceKeyOfLabel(EastSlavic.ROW1_9, key("\u045E", additionalMoreKey("9"))) 62 // U+044B: "" CYRILLIC SMALL LETTER YERU 63 .replaceKeyOfLabel(EastSlavic.ROW2_2, "\u044B") 64 // U+044D: "" CYRILLIC SMALL LETTER E 65 .replaceKeyOfLabel(EastSlavic.ROW2_11, "\u044D") 66 // U+0456: "" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 67 .replaceKeyOfLabel(EastSlavic.ROW3_5, "\u0456") 68 // U+044C: "" CYRILLIC SMALL LETTER SOFT SIGN 69 // U+044A: "" CYRILLIC SMALL LETTER HARD SIGN 70 .setMoreKeysOf("\u044C", "\u044A"); 71 } 72 } 73 } 74