1240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka/*
2240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * Copyright (C) 2014 The Android Open Source Project
3240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka *
4240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * Licensed under the Apache License, Version 2.0 (the "License");
5240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * you may not use this file except in compliance with the License.
6240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * You may obtain a copy of the License at
7240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka *
8240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka *      http://www.apache.org/licenses/LICENSE-2.0
9240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka *
10240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * Unless required by applicable law or agreed to in writing, software
11240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * distributed under the License is distributed on an "AS IS" BASIS,
12240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * See the License for the specific language governing permissions and
14240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * limitations under the License.
15240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka */
16240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
17240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokapackage com.android.inputmethod.keyboard.layout.tests;
18240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
19240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport android.test.suitebuilder.annotation.SmallTest;
20240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
21240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.EastSlavic;
22240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.EastSlavic.EastSlavicCustomizer;
23240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.LayoutBase;
24240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.Symbols;
25240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.SymbolsShifted;
26240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
27240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
28240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
29240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokaimport java.util.Locale;
30240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
31240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka/**
32240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka * uk: Ukrainian/east_slavic
33240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka */
34240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka@SmallTest
35240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaokapublic final class TestsUkrainian extends LayoutTestsBase {
36240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka    private static final Locale LOCALE = new Locale("uk");
37240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka    private static final LayoutBase LAYOUT = new EastSlavic(new UkrainianCustomizer(LOCALE));
38240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
39240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka    @Override
40240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka    LayoutBase getLayout() { return LAYOUT; }
41240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
42240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka    private static class UkrainianCustomizer extends EastSlavicCustomizer {
43240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        public UkrainianCustomizer(final Locale locale) { super(locale); }
44240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
45240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        @Override
46240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        public ExpectedKey getCurrencyKey() { return CURRENCY_HRYVNIA; }
47240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
48240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        @Override
49240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        public ExpectedKey[] getOtherCurrencyKeys() {
50240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka            return SymbolsShifted.CURRENCIES_OTHER_GENERIC;
51240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        }
52240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
53240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        @Override
54240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; }
55240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
56240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        @Override
57240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_R9L; }
58240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
59240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        // U+20B4: "₴" HRYVNIA SIGN
60240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        private static final ExpectedKey CURRENCY_HRYVNIA = key("\u20B4",
61bef6a4e20965a8e664ee92b3c75405a6754afb4eTadashi G. Takaoka                Symbols.CURRENCY_GENERIC_MORE_KEYS);
62240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka
63240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        @Override
64240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
65240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka            return builder
66240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0433: "г" CYRILLIC SMALL LETTER GHE
67240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0491: "ґ" CYRILLIC SMALL LETTER GHE WITH UPTURN
680dabae720a83f9099667dea4de002007fdf35d60Tadashi G. Takaoka                    .setMoreKeysOf("\u0433", "\u0491")
69240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0449: "щ" CYRILLIC SMALL LETTER SHCHA
700dabae720a83f9099667dea4de002007fdf35d60Tadashi G. Takaoka                    .replaceKeyOfLabel(EastSlavic.ROW1_9, key("\u0449", additionalMoreKey("9")))
71240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
72240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0457: "ї" CYRILLIC SMALL LETTER YI
73240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    .replaceKeyOfLabel(EastSlavic.ROW2_2, key("\u0456", moreKey("\u0457")))
74240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0454: "є" CYRILLIC SMALL LETTER UKRAINIAN IE
750dabae720a83f9099667dea4de002007fdf35d60Tadashi G. Takaoka                    .replaceKeyOfLabel(EastSlavic.ROW2_11, "\u0454")
76240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+0438: "и" CYRILLIC SMALL LETTER I
770dabae720a83f9099667dea4de002007fdf35d60Tadashi G. Takaoka                    .replaceKeyOfLabel(EastSlavic.ROW3_5, "\u0438")
78240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN
79240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    // U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN
80240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka                    .setMoreKeysOf("\u044C", "\u044A");
81240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka        }
82240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka    }
83240fb4b3ffeb609545720cc71251425868118a79Tadashi G. Takaoka}
84