Fix for 2466885 : Key prediction is spilling over to next word.

main
Amith Yamasani 2010-02-25 10:37:19 -08:00
parent 6516d0fdfc
commit 9468335a06
1 changed files with 5 additions and 2 deletions

View File

@ -1439,6 +1439,8 @@ public class LatinIME extends InputMethodService
TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord); TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord);
mJustAccepted = true; mJustAccepted = true;
pickSuggestion(mBestWord); pickSuggestion(mBestWord);
// Add the word to the auto dictionary if it's not a known word
checkAddToDictionary(mBestWord, AutoDictionary.FREQUENCY_FOR_TYPED);
} }
} }
@ -1476,6 +1478,8 @@ public class LatinIME extends InputMethodService
} }
mJustAccepted = true; mJustAccepted = true;
pickSuggestion(suggestion); pickSuggestion(suggestion);
// Add the word to the auto dictionary if it's not a known word
checkAddToDictionary(suggestion, AutoDictionary.FREQUENCY_FOR_PICKED);
TextEntryState.acceptedSuggestion(mComposing.toString(), suggestion); TextEntryState.acceptedSuggestion(mComposing.toString(), suggestion);
// Follow it with a space // Follow it with a space
if (mAutoSpace) { if (mAutoSpace) {
@ -1509,10 +1513,9 @@ public class LatinIME extends InputMethodService
ic.commitText(suggestion, 1); ic.commitText(suggestion, 1);
} }
} }
// Add the word to the auto dictionary if it's not a known word
checkAddToDictionary(suggestion, AutoDictionary.FREQUENCY_FOR_PICKED);
mPredicting = false; mPredicting = false;
mCommittedLength = suggestion.length(); mCommittedLength = suggestion.length();
((LatinKeyboard) mInputView.getKeyboard()).setPreferredLetters(null);
setNextSuggestions(); setNextSuggestions();
updateShiftKeyState(getCurrentInputEditorInfo()); updateShiftKeyState(getCurrentInputEditorInfo());
} }