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 Spanish extends LayoutBase {
24     private static final String LAYOUT_NAME = "spanish";
25 
Spanish(final LayoutCustomizer customizer)26     public Spanish(final LayoutCustomizer customizer) {
27         super(customizer, Symbols.class, SymbolsShifted.class);
28     }
29 
30     @Override
getName()31     public String getName() { return LAYOUT_NAME; }
32 
33     @Override
getCommonAlphabetLayout(final boolean isPhone)34     ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
35 
36     public static final String ROW2_10 = "ROW2_10";
37 
38     private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
39             .setKeysOfRow(1,
40                     key("q", additionalMoreKey("1")),
41                     key("w", additionalMoreKey("2")),
42                     key("e", additionalMoreKey("3")),
43                     key("r", additionalMoreKey("4")),
44                     key("t", additionalMoreKey("5")),
45                     key("y", additionalMoreKey("6")),
46                     key("u", additionalMoreKey("7")),
47                     key("i", additionalMoreKey("8")),
48                     key("o", additionalMoreKey("9")),
49                     key("p", additionalMoreKey("0")))
50             .setKeysOfRow(2, "a", "s", "d", "f", "g", "h", "j", "k", "l", ROW2_10)
51             .setKeysOfRow(3, "z", "x", "c", "v", "b", "n", "m")
52             .build();
53 }
54