Simple refactoring (A75)
Change-Id: Id19efc5d279616da52667fa70326b86aba70d4a0
This commit is contained in:
parent
d579f1aefc
commit
e4498929b0
1 changed files with 9 additions and 6 deletions
|
@ -1676,11 +1676,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
final String typedWord = mWordComposer.getTypedWord();
|
final String typedWord = mWordComposer.getTypedWord();
|
||||||
final SuggestedWords suggestions;
|
final SuggestedWords suggestions;
|
||||||
if (!mWordComposer.isComposingWord()) {
|
if (!mWordComposer.isComposingWord() && !mCurrentSettings.mBigramPredictionEnabled) {
|
||||||
if (!mCurrentSettings.mBigramPredictionEnabled) {
|
|
||||||
setPunctuationSuggestions();
|
setPunctuationSuggestions();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mWordComposer.isComposingWord()) {
|
||||||
suggestions = updateBigramPredictions();
|
suggestions = updateBigramPredictions();
|
||||||
} else {
|
} else {
|
||||||
suggestions = updateSuggestions(typedWord);
|
suggestions = updateSuggestions(typedWord);
|
||||||
|
@ -1700,7 +1701,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// getSuggestedWords handles gracefully a null value of prevWord
|
// getSuggestedWords handles gracefully a null value of prevWord
|
||||||
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
|
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
|
||||||
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
|
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
|
||||||
mCurrentSettings.mCorrectionEnabled, false);
|
// !mWordComposer.isComposingWord() is known to be false
|
||||||
|
mCurrentSettings.mCorrectionEnabled, !mWordComposer.isComposingWord());
|
||||||
|
|
||||||
// Basically, we update the suggestion strip only when suggestion count > 1. However,
|
// Basically, we update the suggestion strip only when suggestion count > 1. However,
|
||||||
// there is an exception: We update the suggestion strip whenever typed word's length
|
// there is an exception: We update the suggestion strip whenever typed word's length
|
||||||
|
@ -1894,7 +1896,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 1);
|
mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 1);
|
||||||
return mSuggest.getSuggestedWords(mWordComposer,
|
return mSuggest.getSuggestedWords(mWordComposer,
|
||||||
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
|
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
|
||||||
mCurrentSettings.mCorrectionEnabled, true);
|
// !mWordComposer.isComposingWord() is known to be true
|
||||||
|
mCurrentSettings.mCorrectionEnabled, !mWordComposer.isComposingWord());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPunctuationSuggestions() {
|
public void setPunctuationSuggestions() {
|
||||||
|
|
Loading…
Reference in a new issue