Merge "Move up the static methods of the Builder"
commit
d42b0238f9
|
@ -924,7 +924,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
|||
}
|
||||
|
||||
final List<SuggestedWords.SuggestedWordInfo> applicationSuggestedWords =
|
||||
SuggestedWords.Builder.getFromApplicationSpecifiedCompletions(
|
||||
SuggestedWords.getFromApplicationSpecifiedCompletions(
|
||||
applicationSpecifiedCompletions);
|
||||
SuggestedWords.Builder builder = new SuggestedWords.Builder(applicationSuggestedWords,
|
||||
false /* typedWordValid */,
|
||||
|
@ -1788,7 +1788,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
|||
previousSuggestions = SuggestedWords.EMPTY;
|
||||
}
|
||||
final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions =
|
||||
SuggestedWords.Builder.getTypedWordAndPreviousSuggestions(
|
||||
SuggestedWords.getTypedWordAndPreviousSuggestions(
|
||||
typedWord, previousSuggestions);
|
||||
final SuggestedWords.Builder obsoleteSuggestionsBuilder =
|
||||
new SuggestedWords.Builder(typedWordAndPreviousSuggestions,
|
||||
|
|
|
@ -270,7 +270,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
StringUtils.removeDupes(mSuggestions);
|
||||
|
||||
return new SuggestedWords.Builder(
|
||||
SuggestedWords.Builder.getFromCharSequenceList(mSuggestions),
|
||||
SuggestedWords.getFromCharSequenceList(mSuggestions),
|
||||
false /* typedWordValid */,
|
||||
false /* hasMinimalSuggestion */,
|
||||
false /* allowsToBeAutoCorrected */,
|
||||
|
@ -428,7 +428,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
"--", false));
|
||||
}
|
||||
} else {
|
||||
scoreInfoList = SuggestedWords.Builder.getFromCharSequenceList(mSuggestions);
|
||||
scoreInfoList = SuggestedWords.getFromCharSequenceList(mSuggestions);
|
||||
}
|
||||
|
||||
boolean autoCorrectionAvailable = hasAutoCorrection;
|
||||
|
|
|
@ -98,6 +98,13 @@ public class SuggestedWords {
|
|||
mShouldBlockAutoCorrectionBySafetyNet = shouldBlockAutoCorrectionBySafetyNet;
|
||||
}
|
||||
|
||||
public SuggestedWords build() {
|
||||
return new SuggestedWords(mTypedWordValid, mHasMinimalSuggestion,
|
||||
mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet,
|
||||
mAllowsToBeAutoCorrected, mSuggestedWordInfoList);
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<SuggestedWordInfo> getFromCharSequenceList(
|
||||
final List<CharSequence> wordList) {
|
||||
final ArrayList<SuggestedWordInfo> result = new ArrayList<SuggestedWordInfo>();
|
||||
|
@ -136,13 +143,6 @@ public class SuggestedWords {
|
|||
return suggestionsList;
|
||||
}
|
||||
|
||||
public SuggestedWords build() {
|
||||
return new SuggestedWords(mTypedWordValid, mHasMinimalSuggestion,
|
||||
mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet,
|
||||
mAllowsToBeAutoCorrected, mSuggestedWordInfoList);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SuggestedWordInfo {
|
||||
public final CharSequence mWord;
|
||||
private final CharSequence mDebugString;
|
||||
|
|
Loading…
Reference in New Issue