use of com.android.inputmethod.keyboard.KeyboardLayoutSet in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class AndroidSpellCheckerService method createKeyboardSetForSpellChecker.
private KeyboardLayoutSet createKeyboardSetForSpellChecker(final InputMethodSubtype subtype) {
final EditorInfo editorInfo = new EditorInfo();
editorInfo.inputType = InputType.TYPE_CLASS_TEXT;
final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(this, editorInfo);
builder.setKeyboardGeometry(SPELLCHECKER_DUMMY_KEYBOARD_WIDTH, SPELLCHECKER_DUMMY_KEYBOARD_HEIGHT);
builder.setSubtype(RichInputMethodSubtype.getRichInputMethodSubtype(subtype));
builder.setIsSpellChecker(true);
builder.disableTouchPositionCorrectionData();
return builder.build();
}
use of com.android.inputmethod.keyboard.KeyboardLayoutSet in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class ActionTestsBase method doTestActionKey.
protected void doTestActionKey(final String tag, final InputMethodSubtype subtype, final EditorInfo editorInfo, final ExpectedActionKey expectedKey) {
// Test text layouts.
editorInfo.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
final KeyboardLayoutSet layoutSet = createKeyboardLayoutSet(subtype, editorInfo);
assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_ALPHABET, expectedKey);
assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS, expectedKey);
assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS_SHIFTED, expectedKey);
// Test phone number layouts.
assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE, expectedKey);
assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE_SYMBOLS, expectedKey);
// Test normal number layout.
assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_NUMBER, expectedKey);
// Test number password layout.
editorInfo.inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD;
final KeyboardLayoutSet passwordSet = createKeyboardLayoutSet(subtype, editorInfo);
assertActionKey(tag, passwordSet, KeyboardId.ELEMENT_NUMBER, expectedKey);
}
use of com.android.inputmethod.keyboard.KeyboardLayoutSet in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class AndroidSpellCheckerService method createKeyboardForLocale.
private Keyboard createKeyboardForLocale(final Locale locale) {
final String keyboardLayoutName = getKeyboardLayoutNameForLocale(locale);
final InputMethodSubtype subtype = AdditionalSubtypeUtils.createDummyAdditionalSubtype(locale.toString(), keyboardLayoutName);
final KeyboardLayoutSet keyboardLayoutSet = createKeyboardSetForSpellChecker(subtype);
return keyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET);
}
Aggregations