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