Highlight auto corrected word
Bug: 3230726 Bug: 3215175 Change-Id: I086324cdab610b50a96d8eb08b81aa89c886ba00main
parent
1b1f7f907f
commit
4ca16dbd65
|
@ -633,7 +633,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
if (isSuggestionShown() && isPredictionOn()) {
|
if (isSuggestionShown() && isPredictionOn()) {
|
||||||
// First get the cursor position. This is required by setOldSuggestions(), so that
|
// First get the cursor position. This is required by setOldSuggestions(), so that
|
||||||
// it can pass the correct range to setComposingRegion(). At this point, we don't
|
// it can pass the correct range to setComposingRegion(). At this point, we don't
|
||||||
// have valid values for mLastSelectionStart/Stop because onUpdateSelection() has
|
// have valid values for mLastSelectionStart/End because onUpdateSelection() has
|
||||||
// not been called yet.
|
// not been called yet.
|
||||||
ExtractedTextRequest etr = new ExtractedTextRequest();
|
ExtractedTextRequest etr = new ExtractedTextRequest();
|
||||||
etr.token = 0; // anything is fine here
|
etr.token = 0; // anything is fine here
|
||||||
|
@ -1339,7 +1339,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
CharSequence typedWord = mWord.getTypedWord();
|
CharSequence typedWord = mWord.getTypedWord();
|
||||||
TextEntryState.backToAcceptedDefault(typedWord);
|
TextEntryState.backToAcceptedDefault(typedWord);
|
||||||
if (!TextUtils.isEmpty(typedWord) && !typedWord.equals(mBestWord)) {
|
if (!TextUtils.isEmpty(typedWord) && !typedWord.equals(mBestWord)) {
|
||||||
// TODO: Will call InputConnection.commitCorrection() here.
|
if (ic != null) {
|
||||||
|
CorrectionInfo correctionInfo = new CorrectionInfo(
|
||||||
|
mLastSelectionEnd - typedWord.length(), typedWord, mBestWord);
|
||||||
|
ic.commitCorrection(correctionInfo);
|
||||||
|
}
|
||||||
if (mCandidateView != null)
|
if (mCandidateView != null)
|
||||||
mCandidateView.onAutoCorrectionInverted(mBestWord);
|
mCandidateView.onAutoCorrectionInverted(mBestWord);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue