diff options
author | 2014-10-09 12:02:07 +0000 | |
---|---|---|
committer | 2014-10-09 12:02:07 +0000 | |
commit | a4217f5a92c0697910cdf90fd68a42b22323d0f8 (patch) | |
tree | 9fb87575a038bd2ab28efecc4331cc46721300b5 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 4099611d64923b9d92bf5a3ff43fc63306b6c382 (diff) | |
parent | 65473118655817c7f5382d91c7c4e3d734262a3a (diff) | |
download | latinime-a4217f5a92c0697910cdf90fd68a42b22323d0f8.tar.gz latinime-a4217f5a92c0697910cdf90fd68a42b22323d0f8.tar.xz latinime-a4217f5a92c0697910cdf90fd68a42b22323d0f8.zip |
am 65473118: Merge "Simplify CursorAnchorInfoCompatWrapper"
* commit '65473118655817c7f5382d91c7c4e3d734262a3a':
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)); } /** |