diff options
author | 2014-10-09 08:13:50 +0000 | |
---|---|---|
committer | 2014-10-09 08:13:50 +0000 | |
commit | 65473118655817c7f5382d91c7c4e3d734262a3a (patch) | |
tree | c6e5e052516fdfbc73a2c97971a028a5d2079c59 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 437fcbaa9f9e7de6ccdb6c9ac5f977c0aa6e6bc6 (diff) | |
parent | dac49f9f6de83d9a0cb4d9e290340cde5297e0b3 (diff) | |
download | latinime-65473118655817c7f5382d91c7c4e3d734262a3a.tar.gz latinime-65473118655817c7f5382d91c7c4e3d734262a3a.tar.xz latinime-65473118655817c7f5382d91c7c4e3d734262a3a.zip |
Merge "Simplify CursorAnchorInfoCompatWrapper"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 415958523..d21fa167a 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -795,23 +795,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { - onExtractTextViewPreDraw(); + // CursorAnchorInfo is used on L and later. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) { + if (isFullscreenMode() && mExtractEditText != null) { + mInputLogic.onUpdateCursorAnchorInfo( + CursorAnchorInfoUtils.extractFromTextView(mExtractEditText)); + } + } return true; } }; - private void onExtractTextViewPreDraw() { - // CursorAnchorInfo is available on L and later. - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.L) { - return; - } - if (!isFullscreenMode() || mExtractEditText == null) { - return; - } - final CursorAnchorInfo info = CursorAnchorInfoUtils.getCursorAnchorInfo(mExtractEditText); - mInputLogic.onUpdateCursorAnchorInfo(CursorAnchorInfoCompatWrapper.fromObject(info)); - } - @Override public void setCandidatesView(final View view) { // To ensure that CandidatesView will never be set. @@ -1094,7 +1088,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (isFullscreenMode()) { return; } - mInputLogic.onUpdateCursorAnchorInfo(CursorAnchorInfoCompatWrapper.fromObject(info)); + mInputLogic.onUpdateCursorAnchorInfo(CursorAnchorInfoCompatWrapper.wrap(info)); } /** |