Move some code around (B1)
The goal is to make the creation of the Builder closer to the #build() call Change-Id: I48d76d4efdc180479829016582edd9de47e7332c
This commit is contained in:
parent
23a5e9d1a7
commit
dc5dfe37e0
1 changed files with 3 additions and 2 deletions
|
@ -1816,20 +1816,21 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
} else {
|
} else {
|
||||||
prevWord = EditingUtils.getPreviousWord(ic, mSettingsValues.mWordSeparators);
|
prevWord = EditingUtils.getPreviousWord(ic, mSettingsValues.mWordSeparators);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final CharSequence typedWord = mWordComposer.getTypedWord();
|
||||||
|
final int quotesCount = mWordComposer.trailingSingleQuotesCount();
|
||||||
// getSuggestedWordBuilder handles gracefully a null value of prevWord
|
// getSuggestedWordBuilder handles gracefully a null value of prevWord
|
||||||
final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer,
|
final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer,
|
||||||
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);
|
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);
|
||||||
|
|
||||||
boolean autoCorrectionAvailable = !mInputAttributes.mInputTypeNoAutoCorrect
|
boolean autoCorrectionAvailable = !mInputAttributes.mInputTypeNoAutoCorrect
|
||||||
&& mSuggest.hasAutoCorrection();
|
&& mSuggest.hasAutoCorrection();
|
||||||
final CharSequence typedWord = mWordComposer.getTypedWord();
|
|
||||||
// Here, we want to promote a whitelisted word if exists.
|
// Here, we want to promote a whitelisted word if exists.
|
||||||
// TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
|
// TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
|
||||||
// but still autocorrected from - in the case the whitelist only capitalizes the word.
|
// but still autocorrected from - in the case the whitelist only capitalizes the word.
|
||||||
// The whitelist should be case-insensitive, so it's not possible to be consistent with
|
// The whitelist should be case-insensitive, so it's not possible to be consistent with
|
||||||
// a boolean flag. Right now this is handled with a slight hack in
|
// a boolean flag. Right now this is handled with a slight hack in
|
||||||
// WhitelistDictionary#shouldForciblyAutoCorrectFrom.
|
// WhitelistDictionary#shouldForciblyAutoCorrectFrom.
|
||||||
final int quotesCount = mWordComposer.trailingSingleQuotesCount();
|
|
||||||
final boolean allowsToBeAutoCorrected = AutoCorrection.allowsToBeAutoCorrected(
|
final boolean allowsToBeAutoCorrected = AutoCorrection.allowsToBeAutoCorrected(
|
||||||
mSuggest.getUnigramDictionaries(),
|
mSuggest.getUnigramDictionaries(),
|
||||||
// If the typed string ends with a single quote, for dictionary lookup purposes
|
// If the typed string ends with a single quote, for dictionary lookup purposes
|
||||||
|
|
Loading…
Reference in a new issue