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