TestsGermanDvorak.java revision e40a52cc6213bd025655d86dae7d4ee6dcd38682
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.tests; 18 19import android.test.suitebuilder.annotation.SmallTest; 20 21import com.android.inputmethod.keyboard.layout.Dvorak; 22import com.android.inputmethod.keyboard.layout.Dvorak.DvorakCustomizer; 23import com.android.inputmethod.keyboard.layout.LayoutBase; 24import com.android.inputmethod.keyboard.layout.Symbols; 25import com.android.inputmethod.keyboard.layout.SymbolsShifted; 26import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; 27import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; 28 29import java.util.Locale; 30 31/** 32 * de: German/dvorak 33 */ 34@SmallTest 35public final class TestsGermanDvorak extends LayoutTestsBase { 36 private static final Locale LOCALE = new Locale("de"); 37 private static final LayoutBase LAYOUT = new Dvorak(new GermanDvorakCustomizer(LOCALE)); 38 39 @Override 40 LayoutBase getLayout() { return LAYOUT; } 41 42 static class GermanDvorakCustomizer extends DvorakCustomizer { 43 final GermanCustomizer mGermanCustomizer; 44 45 public GermanDvorakCustomizer(final Locale locale) { 46 super(locale); 47 mGermanCustomizer = new GermanCustomizer(locale); 48 } 49 50 @Override 51 public ExpectedKey getCurrencyKey() { return Symbols.CURRENCY_EURO; } 52 53 @Override 54 public ExpectedKey[] getOtherCurrencyKeys() { 55 return SymbolsShifted.CURRENCIES_OTHER_THAN_EURO; 56 } 57 58 @Override 59 public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_R9L; } 60 61 @Override 62 public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_R9L; } 63 64 @Override 65 public ExpectedKey[] getDoubleAngleQuoteKeys() { return Symbols.DOUBLE_ANGLE_QUOTES_RL; } 66 67 @Override 68 public ExpectedKey[] getSingleAngleQuoteKeys() { return Symbols.SINGLE_ANGLE_QUOTES_RL; } 69 70 @Override 71 public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) { 72 return mGermanCustomizer.setAccentedLetters(builder); 73 } 74 } 75} 76