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