use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class TestsQwertyEmail method createKeyboardLayoutSet.
@Override
protected KeyboardLayoutSet createKeyboardLayoutSet(final InputMethodSubtype subtype, final EditorInfo editorInfo, final boolean voiceInputKeyEnabled, final boolean languageSwitchKeyEnabled, final boolean splitLayoutEnabled) {
final EditorInfo emailField = new EditorInfo();
emailField.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
return super.createKeyboardLayoutSet(subtype, emailField, voiceInputKeyEnabled, languageSwitchKeyEnabled, splitLayoutEnabled);
}
use of android.view.inputmethod.EditorInfo in project double-espresso by JakeWharton.
the class EditorAction method perform.
@Override
public void perform(UiController uiController, View view) {
EditorInfo editorInfo = new EditorInfo();
InputConnection inputConnection = view.onCreateInputConnection(editorInfo);
if (inputConnection == null) {
throw new PerformException.Builder().withActionDescription(this.toString()).withViewDescription(HumanReadables.describe(view)).withCause(new IllegalStateException("View does not support input methods")).build();
}
int actionId = editorInfo.actionId != 0 ? editorInfo.actionId : editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
if (actionId == EditorInfo.IME_ACTION_NONE) {
throw new PerformException.Builder().withActionDescription(this.getDescription()).withViewDescription(HumanReadables.describe(view)).withCause(new IllegalStateException("No available action on view")).build();
}
if (!inputConnection.performEditorAction(actionId)) {
throw new PerformException.Builder().withActionDescription(this.getDescription()).withViewDescription(HumanReadables.describe(view)).withCause(new RuntimeException(String.format("Failed to perform action %#x. Input connection no longer valid", actionId))).build();
}
}
Aggregations