Make a method static

Change-Id: Ie1d460562d38105abe91ae2da17cafd49e2cd394
This commit is contained in:
Jean Chalard 2012-03-12 15:00:36 +09:00
parent 2de0c4b754
commit 1dfef0336d
2 changed files with 10 additions and 4 deletions

View file

@ -72,6 +72,7 @@ import com.android.inputmethod.latin.suggestions.SuggestionsView;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.List;
import java.util.Locale; import java.util.Locale;
/** /**
@ -979,8 +980,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
return; return;
} }
final List<CharSequence> applicationSuggestedWords =
SuggestedWords.Builder.getFromApplicationSpecifiedCompletions(
applicationSpecifiedCompletions);
SuggestedWords.Builder builder = new SuggestedWords.Builder() SuggestedWords.Builder builder = new SuggestedWords.Builder()
.setApplicationSpecifiedCompletions(applicationSpecifiedCompletions) .addWords(applicationSuggestedWords, null)
.setTypedWordValid(false) .setTypedWordValid(false)
.setHasMinimalSuggestion(false); .setHasMinimalSuggestion(false);
// When in fullscreen mode, show completions generated by the application // When in fullscreen mode, show completions generated by the application

View file

@ -131,11 +131,13 @@ public class SuggestedWords {
return this; return this;
} }
public Builder setApplicationSpecifiedCompletions(CompletionInfo[] infos) { public static List<CharSequence> getFromApplicationSpecifiedCompletions(
final CompletionInfo[] infos) {
final ArrayList<CharSequence> result = new ArrayList<CharSequence>();
for (CompletionInfo info : infos) { for (CompletionInfo info : infos) {
if (null != info) addWord(info.getText()); if (null != info) result.add(info.getText());
} }
return this; return result;
} }
public Builder setTypedWordValid(boolean typedWordValid) { public Builder setTypedWordValid(boolean typedWordValid) {