Java Code Examples for android.view.inputmethod.EditorInfo#IME_FLAG_NO_FULLSCREEN

The following examples show how to use android.view.inputmethod.EditorInfo#IME_FLAG_NO_FULLSCREEN . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    final InputConnection ic = super.onCreateInputConnection(outAttrs);
    if (ic != null) {
        if (outAttrs.hintText == null) {
            // If we don't have a hint and our parent is a TextInputLayout, use it's hint for the
            // EditorInfo. This allows us to display a hint in 'extract mode'.
            final ViewParent parent = getParent();
            if (parent instanceof TextInputLayout) {
                outAttrs.hintText = ((TextInputLayout) parent).getHint();
            }
        }
        outAttrs.imeOptions = outAttrs.imeOptions | EditorInfo.IME_FLAG_NO_FULLSCREEN;
    }
    return ic;
}
 
Example 2
/**
 * Override this to control when the input method should run in
 * fullscreen mode.  The default implementation runs in fullsceen only
 * when the screen is in landscape mode.  If you change what
 * this returns, you will need to call {@link #updateFullscreenMode()}
 * yourself whenever the returned value may have changed to have it
 * re-evaluated and applied.
 */
public boolean onEvaluateFullscreenMode() {
    Configuration config = getResources().getConfiguration();
    if (config.orientation != Configuration.ORIENTATION_LANDSCAPE) {
        return false;
    }
    if (mInputEditorInfo != null
            && (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0) {
        return false;
    }
    return true;
}
 
Example 3
@Override
public InputConnection onCreateInputConnection(EditorInfo editorinfo) {
	BaseInputConnection bic = new BaseInputConnection(this, false);
	editorinfo.actionLabel = null;
	editorinfo.inputType = InputType.TYPE_NULL;
	editorinfo.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
	bic.finishComposingText();
	return bic;
}
 
Example 4
Source Project: simpleSDL   File: SDLActivity.java    License: MIT License 5 votes vote down vote up
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    ic = new SDLInputConnection(this, true);

    outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
            | EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;

    return ic;
}
 
Example 5
Source Project: 365browser   File: ImeAdapter.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @see View#onCreateInputConnection(EditorInfo)
 * @param allowKeyboardLearning Whether to allow keyboard (IME) app to do personalized learning.
 */
public ChromiumBaseInputConnection onCreateInputConnection(
        EditorInfo outAttrs, boolean allowKeyboardLearning) {
    // InputMethodService evaluates fullscreen mode even when the new input connection is
    // null. This makes sure IME doesn't enter fullscreen mode or open custom UI.
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN | EditorInfo.IME_FLAG_NO_EXTRACT_UI;

    // TODO(changwan): Replace with EditorInfoCompat#IME_FLAG_NO_PERSONALIZED_LEARNING or
    //                 EditorInfo#IME_FLAG_NO_PERSONALIZED_LEARNING as soon as either is
    //                 available in all build config types.
    if (!allowKeyboardLearning) outAttrs.imeOptions |= IME_FLAG_NO_PERSONALIZED_LEARNING;
    // Without this line, some third-party IMEs will try to compose text even when
    // not on an editable node. Even when we return null here, key events can still go
    // through ImeAdapter#dispatchKeyEvent().
    if (mTextInputType == TextInputType.NONE) {
        setInputConnection(null);
        if (DEBUG_LOGS) Log.i(TAG, "onCreateInputConnection returns null.");
        return null;
    }
    if (mInputConnectionFactory == null) return null;
    setInputConnection(mInputConnectionFactory.initializeAndGet(mContainerView, this,
            mTextInputType, mTextInputFlags, mTextInputMode, mLastSelectionStart,
            mLastSelectionEnd, outAttrs));
    if (DEBUG_LOGS) Log.i(TAG, "onCreateInputConnection: " + mInputConnection);

    if (mCursorAnchorInfoController != null) {
        mCursorAnchorInfoController.onRequestCursorUpdates(false /* not an immediate request */,
                false /* disable monitoring */, mContainerView);
    }
    if (isValid()) {
        nativeRequestCursorUpdate(mNativeImeAdapterAndroid,
                false /* not an immediate request */, false /* disable monitoring */);
    }
    return mInputConnection;
}
 
Example 6
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    ic = new SDLInputConnection(this, true);

    outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
            | EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;

    return ic;
}
 
Example 7
/**
 * @see View#onCreateInputConnection(EditorInfo)
 */
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    if (!mImeAdapter.hasTextInputType()) {
        // Although onCheckIsTextEditor will return false in this case, the EditorInfo
        // is still used by the InputMethodService. Need to make sure the IME doesn't
        // enter fullscreen mode.
        outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    }
    mInputConnection =
            mAdapterInputConnectionFactory.get(mContainerView, mImeAdapter, outAttrs);
    return mInputConnection;
}
 
Example 8
/**
 * @see View#onCreateInputConnection(EditorInfo)
 */
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    if (!mImeAdapter.hasTextInputType()) {
        // Although onCheckIsTextEditor will return false in this case, the EditorInfo
        // is still used by the InputMethodService. Need to make sure the IME doesn't
        // enter fullscreen mode.
        outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    }
    mInputConnection =
            mAdapterInputConnectionFactory.get(mContainerView, mImeAdapter, outAttrs);
    return mInputConnection;
}
 
Example 9
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    InputConnection conn = super.onCreateInputConnection(outAttrs);
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return conn;
}
 
Example 10
Source Project: delion   File: NewTabPageScrollView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes lanscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 11
Source Project: delion   File: NewTabPageRecyclerView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes landscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 12
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes lanscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 13
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes lanscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 14
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes landscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 15
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes lanscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 16
Source Project: 365browser   File: NewTabPageScrollView.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes lanscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 17
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes lanscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 18
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    // Fixes landscape transitions when unfocusing the URL bar: crbug.com/288546
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
    return super.onCreateInputConnection(outAttrs);
}
 
Example 19
@VisibleForTesting
AdapterInputConnection(View view, ImeAdapter imeAdapter, EditorInfo outAttrs) {
    super(view, true);
    mInternalView = view;
    mImeAdapter = imeAdapter;
    mImeAdapter.setInputConnection(this);
    mSingleLine = true;
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN
            | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
    outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT
            | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT;

    if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeText) {
        // Normal text field
        outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeTextArea ||
            imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeContentEditable) {
        // TextArea or contenteditable.
        outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE
                | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES
                | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_NONE;
        mSingleLine = false;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypePassword) {
        // Password
        outAttrs.inputType = InputType.TYPE_CLASS_TEXT
                | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeSearch) {
        // Search
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_SEARCH;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeUrl) {
        // Url
        // TYPE_TEXT_VARIATION_URI prevents Tab key from showing, so
        // exclude it for now.
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeEmail) {
        // Email
        outAttrs.inputType = InputType.TYPE_CLASS_TEXT
                | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeTel) {
        // Telephone
        // Number and telephone do not have both a Tab key and an
        // action in default OSK, so set the action to NEXT
        outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeNumber) {
        // Number
        outAttrs.inputType = InputType.TYPE_CLASS_NUMBER
                | InputType.TYPE_NUMBER_VARIATION_NORMAL;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
    }
    outAttrs.initialSelStart = imeAdapter.getInitialSelectionStart();
    outAttrs.initialSelEnd = imeAdapter.getInitialSelectionEnd();
    mLastUpdateSelectionStart = imeAdapter.getInitialSelectionStart();
    mLastUpdateSelectionEnd = imeAdapter.getInitialSelectionEnd();
}
 
Example 20
@VisibleForTesting
AdapterInputConnection(View view, ImeAdapter imeAdapter, EditorInfo outAttrs) {
    super(view, true);
    mInternalView = view;
    mImeAdapter = imeAdapter;
    mImeAdapter.setInputConnection(this);
    mSingleLine = true;
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN
            | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
    outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT
            | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT;

    if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeText) {
        // Normal text field
        outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeTextArea ||
            imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeContentEditable) {
        // TextArea or contenteditable.
        outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE
                | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES
                | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_NONE;
        mSingleLine = false;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypePassword) {
        // Password
        outAttrs.inputType = InputType.TYPE_CLASS_TEXT
                | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeSearch) {
        // Search
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_SEARCH;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeUrl) {
        // Url
        // TYPE_TEXT_VARIATION_URI prevents Tab key from showing, so
        // exclude it for now.
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeEmail) {
        // Email
        outAttrs.inputType = InputType.TYPE_CLASS_TEXT
                | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_GO;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeTel) {
        // Telephone
        // Number and telephone do not have both a Tab key and an
        // action in default OSK, so set the action to NEXT
        outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
    } else if (imeAdapter.getTextInputType() == ImeAdapter.sTextInputTypeNumber) {
        // Number
        outAttrs.inputType = InputType.TYPE_CLASS_NUMBER
                | InputType.TYPE_NUMBER_VARIATION_NORMAL;
        outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT;
    }
    outAttrs.initialSelStart = imeAdapter.getInitialSelectionStart();
    outAttrs.initialSelEnd = imeAdapter.getInitialSelectionEnd();
    mLastUpdateSelectionStart = imeAdapter.getInitialSelectionStart();
    mLastUpdateSelectionEnd = imeAdapter.getInitialSelectionEnd();
}