android.view.inputmethod.CursorAnchorInfo Java Examples
The following examples show how to use
android.view.inputmethod.CursorAnchorInfo.
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 check out the related API usage on the sidebar.
Example #1
Source File: InputMethodService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
/** * Call {@link InputMethodService#onUpdateCursorAnchorInfo * InputMethodService.onUpdateCursorAnchorInfo()}. */ public void updateCursorAnchorInfo(CursorAnchorInfo info) { if (!isEnabled()) { return; } InputMethodService.this.onUpdateCursorAnchorInfo(info); }
Example #2
Source File: Session.java From FirefoxReality with Mozilla Public License 2.0 | 5 votes |
@Override public void updateCursorAnchorInfo(@NonNull GeckoSession aSession, @NonNull CursorAnchorInfo info) { if (mState.mSession == aSession) { for (GeckoSession.TextInputDelegate listener : mTextInputListeners) { listener.updateCursorAnchorInfo(aSession, info); } } }
Example #3
Source File: CursorAnchorInfoCompatWrapper.java From AOSP-Kayboard-7.1.2 with Apache License 2.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Nullable public static CursorAnchorInfoCompatWrapper wrap(@Nullable final CursorAnchorInfo instance) { if (BuildCompatUtils.EFFECTIVE_SDK_INT < Build.VERSION_CODES.LOLLIPOP) { return null; } if (instance == null) { return null; } return new RealWrapper(instance); }
Example #4
Source File: InputMethodManagerWrapper.java From 365browser with Apache License 2.0 | 5 votes |
/** * @see android.view.inputmethod.InputMethodManager#updateCursorAnchorInfo(View, * CursorAnchorInfo) */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) public void updateCursorAnchorInfo(View view, CursorAnchorInfo cursorAnchorInfo) { if (DEBUG_LOGS) Log.i(TAG, "updateCursorAnchorInfo"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getInputMethodManager().updateCursorAnchorInfo(view, cursorAnchorInfo); } }
Example #5
Source File: CursorAnchorInfoCompatWrapper.java From Indic-Keyboard with Apache License 2.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Nullable public static CursorAnchorInfoCompatWrapper wrap(@Nullable final CursorAnchorInfo instance) { if (BuildCompatUtils.EFFECTIVE_SDK_INT < Build.VERSION_CODES.LOLLIPOP) { return null; } if (instance == null) { return null; } return new RealWrapper(instance); }
Example #6
Source File: IInputMethodSessionWrapper.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
@Override public void updateCursorAnchorInfo(CursorAnchorInfo cursorAnchorInfo) { mCaller.executeOrSendMessage( mCaller.obtainMessageO(DO_UPDATE_CURSOR_ANCHOR_INFO, cursorAnchorInfo)); }
Example #7
Source File: CursorAnchorInfoCompatWrapper.java From AOSP-Kayboard-7.1.2 with Apache License 2.0 | 4 votes |
public RealWrapper(@Nonnull final CursorAnchorInfo info) { mInstance = info; }
Example #8
Source File: CursorAnchorInfoController.java From 365browser with Apache License 2.0 | 4 votes |
/** * Computes the CursorAnchorInfo instance and notify to InputMethodManager if needed. */ private void updateCursorAnchorInfo(View view) { if (!mHasCoordinateInfo) return; if (mLastCursorAnchorInfo == null) { // Reuse the builder object. mCursorAnchorInfoBuilder.reset(); CharSequence text = mComposingTextDelegate.getText(); int selectionStart = mComposingTextDelegate.getSelectionStart(); int selectionEnd = mComposingTextDelegate.getSelectionEnd(); int composingTextStart = mComposingTextDelegate.getComposingTextStart(); int composingTextEnd = mComposingTextDelegate.getComposingTextEnd(); if (text != null && 0 <= composingTextStart && composingTextEnd <= text.length()) { mCursorAnchorInfoBuilder.setComposingText(composingTextStart, text.subSequence(composingTextStart, composingTextEnd)); float[] compositionCharacterBounds = mCompositionCharacterBounds; if (compositionCharacterBounds != null) { int numCharacter = compositionCharacterBounds.length / 4; for (int i = 0; i < numCharacter; ++i) { float left = compositionCharacterBounds[i * 4]; float top = compositionCharacterBounds[i * 4 + 1]; float right = compositionCharacterBounds[i * 4 + 2]; float bottom = compositionCharacterBounds[i * 4 + 3]; int charIndex = composingTextStart + i; mCursorAnchorInfoBuilder.addCharacterBounds(charIndex, left, top, right, bottom, CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION); } } } mCursorAnchorInfoBuilder.setSelectionRange(selectionStart, selectionEnd); mMatrix.setScale(mScale, mScale); mMatrix.postTranslate(mTranslationX, mTranslationY); mCursorAnchorInfoBuilder.setMatrix(mMatrix); if (mHasInsertionMarker) { mCursorAnchorInfoBuilder.setInsertionMarkerLocation( mInsertionMarkerHorizontal, mInsertionMarkerTop, mInsertionMarkerBottom, mInsertionMarkerBottom, mIsInsertionMarkerVisible ? CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION : CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION); } mLastCursorAnchorInfo = mCursorAnchorInfoBuilder.build(); } if (mInputMethodManagerWrapper != null) { mInputMethodManagerWrapper.updateCursorAnchorInfo(view, mLastCursorAnchorInfo); } mHasPendingImmediateRequest = false; }
Example #9
Source File: CursorAnchorInfoCompatWrapper.java From Indic-Keyboard with Apache License 2.0 | 4 votes |
public RealWrapper(@Nonnull final CursorAnchorInfo info) { mInstance = info; }
Example #10
Source File: InputMethodService.java From android_9.0.0_r45 with Apache License 2.0 | 2 votes |
/** * Called when the application has reported a new location of its text insertion point and * characters in the composition string. This is only called if explicitly requested by the * input method. The default implementation does nothing. * @param cursorAnchorInfo The positional information of the text insertion point and the * composition string. */ public void onUpdateCursorAnchorInfo(CursorAnchorInfo cursorAnchorInfo) { // Intentionally empty }