Home | History | Annotate | Download | only in layout
      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;
     18 
     19 import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer;
     20 import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
     21 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
     22 
     23 public final class EastSlavic extends LayoutBase {
     24     private static final String LAYOUT_NAME = "east_slavic";
     25 
     26     public EastSlavic(final LayoutCustomizer customizer) {
     27         super(customizer, Symbols.class, SymbolsShifted.class);
     28     }
     29 
     30     @Override
     31     public String getName() { return LAYOUT_NAME; }
     32 
     33     @Override
     34     ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
     35 
     36     public static final String ROW1_9 = "ROW1_9";
     37     public static final String ROW2_2 = "ROW2_2";
     38     public static final String ROW2_11 = "ROW2_11";
     39     public static final String ROW3_5 = "ROW3_5";
     40 
     41     private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
     42             .setKeysOfRow(1,
     43                     // U+0443: "" CYRILLIC SMALL LETTER U
     44                     key("\u0439", additionalMoreKey("1")),
     45                     // U+0446: "" CYRILLIC SMALL LETTER TSE
     46                     key("\u0446", additionalMoreKey("2")),
     47                     // U+0439: "" CYRILLIC SMALL LETTER SHORT I
     48                     key("\u0443", additionalMoreKey("3")),
     49                     // U+043A: "" CYRILLIC SMALL LETTER KA
     50                     key("\u043A", additionalMoreKey("4")),
     51                     // U+0435: "" CYRILLIC SMALL LETTER IE
     52                     key("\u0435", additionalMoreKey("5")),
     53                     // U+043D: "" CYRILLIC SMALL LETTER EN
     54                     key("\u043D", additionalMoreKey("6")),
     55                     // U+0433: "" CYRILLIC SMALL LETTER GHE
     56                     key("\u0433", additionalMoreKey("7")),
     57                     // U+0448: "" CYRILLIC SMALL LETTER SHA
     58                     key("\u0448", additionalMoreKey("8")),
     59                     key(ROW1_9, additionalMoreKey("9")),
     60                     // U+0437: "" CYRILLIC SMALL LETTER ZE
     61                     key("\u0437", additionalMoreKey("0")),
     62                     // U+0445: "" CYRILLIC SMALL LETTER HA
     63                     "\u0445")
     64             .setKeysOfRow(2,
     65                     // U+0444: "" CYRILLIC SMALL LETTER EF
     66                     // U+0432: "" CYRILLIC SMALL LETTER VE
     67                     // U+0430: "" CYRILLIC SMALL LETTER A
     68                     // U+043F: "" CYRILLIC SMALL LETTER PE
     69                     // U+0440: "" CYRILLIC SMALL LETTER ER
     70                     // U+043E: "" CYRILLIC SMALL LETTER O
     71                     // U+043B: "" CYRILLIC SMALL LETTER EL
     72                     // U+0434: "" CYRILLIC SMALL LETTER DE
     73                     // U+0436: "" CYRILLIC SMALL LETTER ZHE
     74                     "\u0444", ROW2_2, "\u0432", "\u0430", "\u043F", "\u0440", "\u043E", "\u043B",
     75                     "\u0434", "\u0436", ROW2_11)
     76             .setKeysOfRow(3,
     77                     // U+044F: "" CYRILLIC SMALL LETTER YA
     78                     // U+0447: "" CYRILLIC SMALL LETTER CHE
     79                     // U+0441: "" CYRILLIC SMALL LETTER ES
     80                     // U+043C: "" CYRILLIC SMALL LETTER EM
     81                     // U+0442: "" CYRILLIC SMALL LETTER TE
     82                     // U+044C: "" CYRILLIC SMALL LETTER SOFT SIGN
     83                     // U+0431: "" CYRILLIC SMALL LETTER BE
     84                     // U+044E: "" CYRILLIC SMALL LETTER YU
     85                     "\u044F", "\u0447", "\u0441", "\u043C", ROW3_5, "\u0442", "\u044C", "\u0431",
     86                     "\u044E")
     87             .build();
     88 }
     89