Search in sources :

Example 46 with EditorInfo

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);
}
Also used : EditorInfo(android.view.inputmethod.EditorInfo)

Example 47 with EditorInfo

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();
    }
}
Also used : InputConnection(android.view.inputmethod.InputConnection) EditorInfo(android.view.inputmethod.EditorInfo)

Aggregations

EditorInfo (android.view.inputmethod.EditorInfo)47 InputConnection (android.view.inputmethod.InputConnection)19 IInputContext (com.android.internal.view.IInputContext)12 IInputMethod (com.android.internal.view.IInputMethod)12 SomeArgs (com.android.internal.os.SomeArgs)11 ExtractedTextRequest (android.view.inputmethod.ExtractedTextRequest)8 IBinder (android.os.IBinder)7 InputBinding (android.view.inputmethod.InputBinding)7 InputMethod (android.view.inputmethod.InputMethod)7 InputConnectionWrapper (com.android.internal.view.InputConnectionWrapper)7 FileDescriptor (java.io.FileDescriptor)7 PrintWriter (java.io.PrintWriter)7 RemoteException (android.os.RemoteException)5 InputChannel (android.view.InputChannel)5 IInputMethodClient (com.android.internal.view.IInputMethodClient)5 IInputSessionCallback (com.android.internal.view.IInputSessionCallback)5 InputBindResult (com.android.internal.view.InputBindResult)5 SettingsValues (com.android.inputmethod.latin.settings.SettingsValues)3 Printer (android.util.Printer)2 ViewGroup (android.view.ViewGroup)2