Search in sources :

Example 6 with BaseInputConnection

use of android.view.inputmethod.BaseInputConnection in project lottie-android by airbnb.

the class LottieFontViewGroup method onCreateInputConnection.

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    BaseInputConnection fic = new BaseInputConnection(this, false);
    outAttrs.actionLabel = null;
    outAttrs.inputType = InputType.TYPE_NULL;
    outAttrs.imeOptions = EditorInfo.IME_ACTION_NEXT;
    return fic;
}
Also used : BaseInputConnection(android.view.inputmethod.BaseInputConnection)

Example 7 with BaseInputConnection

use of android.view.inputmethod.BaseInputConnection in project platform_frameworks_base by android.

the class AbsListView method onCreateInputConnection.

/**
     * Return an InputConnection for editing of the filter text.
     */
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    if (isTextFilterEnabled()) {
        if (mPublicInputConnection == null) {
            mDefInputConnection = new BaseInputConnection(this, false);
            mPublicInputConnection = new InputConnectionWrapper(outAttrs);
        }
        outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_FILTER;
        outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
        return mPublicInputConnection;
    }
    return null;
}
Also used : BaseInputConnection(android.view.inputmethod.BaseInputConnection)

Example 8 with BaseInputConnection

use of android.view.inputmethod.BaseInputConnection in project XobotOS by xamarin.

the class AbsListView method onCreateInputConnection.

/**
     * Return an InputConnection for editing of the filter text.
     */
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    if (isTextFilterEnabled()) {
        // XXX we need to have the text filter created, so we can get an
        // InputConnection to proxy to.  Unfortunately this means we pretty
        // much need to make it as soon as a list view gets focus.
        createTextFilter(false);
        if (mPublicInputConnection == null) {
            mDefInputConnection = new BaseInputConnection(this, false);
            mPublicInputConnection = new InputConnectionWrapper(mTextFilter.onCreateInputConnection(outAttrs), true) {

                @Override
                public boolean reportFullscreenMode(boolean enabled) {
                    // the "real" one the IME is talking with.
                    return mDefInputConnection.reportFullscreenMode(enabled);
                }

                @Override
                public boolean performEditorAction(int editorAction) {
                    // the one that does this.
                    if (editorAction == EditorInfo.IME_ACTION_DONE) {
                        InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                        if (imm != null) {
                            imm.hideSoftInputFromWindow(getWindowToken(), 0);
                        }
                        return true;
                    }
                    return false;
                }

                @Override
                public boolean sendKeyEvent(KeyEvent event) {
                    // no ViewAncestor to dispatch events with.
                    return mDefInputConnection.sendKeyEvent(event);
                }
            };
        }
        outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_FILTER;
        outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
        return mPublicInputConnection;
    }
    return null;
}
Also used : BaseInputConnection(android.view.inputmethod.BaseInputConnection) KeyEvent(android.view.KeyEvent) InputConnectionWrapper(android.view.inputmethod.InputConnectionWrapper) InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 9 with BaseInputConnection

use of android.view.inputmethod.BaseInputConnection in project android_frameworks_base by AOSPA.

the class AbsListView method onCreateInputConnection.

/**
     * Return an InputConnection for editing of the filter text.
     */
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    if (isTextFilterEnabled()) {
        if (mPublicInputConnection == null) {
            mDefInputConnection = new BaseInputConnection(this, false);
            mPublicInputConnection = new InputConnectionWrapper(outAttrs);
        }
        outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_FILTER;
        outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
        return mPublicInputConnection;
    }
    return null;
}
Also used : BaseInputConnection(android.view.inputmethod.BaseInputConnection)

Example 10 with BaseInputConnection

use of android.view.inputmethod.BaseInputConnection in project android_frameworks_base by ResurrectionRemix.

the class AbsListView method onCreateInputConnection.

/**
     * Return an InputConnection for editing of the filter text.
     */
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    if (isTextFilterEnabled()) {
        if (mPublicInputConnection == null) {
            mDefInputConnection = new BaseInputConnection(this, false);
            mPublicInputConnection = new InputConnectionWrapper(outAttrs);
        }
        outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_FILTER;
        outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
        return mPublicInputConnection;
    }
    return null;
}
Also used : BaseInputConnection(android.view.inputmethod.BaseInputConnection)

Aggregations

BaseInputConnection (android.view.inputmethod.BaseInputConnection)15 KeyEvent (android.view.KeyEvent)7 InputConnectionWrapper (android.view.inputmethod.InputConnectionWrapper)2 InputMethodManager (android.view.inputmethod.InputMethodManager)2 Paint (android.graphics.Paint)1 Bundle (android.os.Bundle)1 CompletionInfo (android.view.inputmethod.CompletionInfo)1 CorrectionInfo (android.view.inputmethod.CorrectionInfo)1 ExtractedTextRequest (android.view.inputmethod.ExtractedTextRequest)1 IOException (java.io.IOException)1