Search in sources :

Example 26 with EditorInfo

use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class TestsDvorakUrl 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_URI;
    return super.createKeyboardLayoutSet(subtype, emailField, voiceInputKeyEnabled, languageSwitchKeyEnabled, splitLayoutEnabled);
}
Also used : EditorInfo(android.view.inputmethod.EditorInfo)

Example 27 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 28 with EditorInfo

use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class TestsQwertyUrl 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_URI;
    return super.createKeyboardLayoutSet(subtype, emailField, voiceInputKeyEnabled, languageSwitchKeyEnabled, splitLayoutEnabled);
}
Also used : EditorInfo(android.view.inputmethod.EditorInfo)

Example 29 with EditorInfo

use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class InputTestsBase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mEditText = new MyEditText(getContext());
    final int inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
    mEditText.setInputType(inputType);
    mEditText.setEnabled(true);
    mLastCursorPos = 0;
    if (null == Looper.myLooper()) {
        Looper.prepare();
    }
    setupService();
    mLatinIME = getService();
    setDebugMode(true);
    mPreviousBigramPredictionSettings = setBooleanPreference(Settings.PREF_BIGRAM_PREDICTIONS, true, true);
    mPreviousAutoCorrectSetting = setBooleanPreference(Settings.PREF_AUTO_CORRECTION, DEFAULT_AUTO_CORRECTION, DEFAULT_AUTO_CORRECTION);
    mLatinIME.onCreate();
    EditorInfo ei = new EditorInfo();
    final InputConnection ic = mEditText.onCreateInputConnection(ei);
    final LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    final ViewGroup vg = new FrameLayout(getContext());
    mInputView = inflater.inflate(R.layout.input_view, vg);
    ei = enrichEditorInfo(ei);
    mLatinIME.onCreateInputMethodInterface().startInput(ic, ei);
    mLatinIME.setInputView(mInputView);
    mLatinIME.onBindInput();
    mLatinIME.onCreateInputView();
    mLatinIME.onStartInputView(ei, false);
    mInputConnection = ic;
    changeLanguage("en_US");
    // Run messages to avoid the messages enqueued by startInputView() and its friends
    // to run on a later call and ruin things. We need to wait first because some of them
    // can be posted with a delay (notably,  MSG_RESUME_SUGGESTIONS)
    sleep(DELAY_TO_WAIT_FOR_PREDICTIONS_MILLIS);
    runMessages();
}
Also used : InputConnection(android.view.inputmethod.InputConnection) EditorInfo(android.view.inputmethod.EditorInfo) ViewGroup(android.view.ViewGroup) LayoutInflater(android.view.LayoutInflater) FrameLayout(android.widget.FrameLayout) Point(android.graphics.Point)

Example 30 with EditorInfo

use of android.view.inputmethod.EditorInfo in project android_packages_inputmethods_LatinIME by CyanogenMod.

the class LatinIME method onEvaluateFullscreenMode.

@Override
public boolean onEvaluateFullscreenMode() {
    final SettingsValues settingsValues = mSettings.getCurrent();
    if (isImeSuppressedByHardwareKeyboard()) {
        // If there is a hardware keyboard, disable full screen mode.
        return false;
    }
    // Reread resource value here, because this method is called by the framework as needed.
    final boolean isFullscreenModeAllowed = Settings.readUseFullscreenMode(getResources());
    if (super.onEvaluateFullscreenMode() && isFullscreenModeAllowed) {
        // TODO: Remove this hack. Actually we should not really assume NO_EXTRACT_UI
        // implies NO_FULLSCREEN. However, the framework mistakenly does.  i.e. NO_EXTRACT_UI
        // without NO_FULLSCREEN doesn't work as expected. Because of this we need this
        // hack for now.  Let's get rid of this once the framework gets fixed.
        final EditorInfo ei = getCurrentInputEditorInfo();
        return !(ei != null && ((ei.imeOptions & EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0));
    }
    return false;
}
Also used : EditorInfo(android.view.inputmethod.EditorInfo) SettingsValues(com.android.inputmethod.latin.settings.SettingsValues)

Aggregations

EditorInfo (android.view.inputmethod.EditorInfo)43 InputConnection (android.view.inputmethod.InputConnection)20 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 ViewGroup (android.view.ViewGroup)2 InputMethodSubtype (android.view.inputmethod.InputMethodSubtype)2