Remove mIsApplicationSpecifiedCompletions flags from SuggestedWords

Bug: 3504990
Change-Id: Ib7588ab05fa8b8ab58bf3bea6ff1f644c53ebb94
main
Tadashi G. Takaoka 2011-03-02 17:17:15 -08:00
parent c2bbc6a449
commit 1eff7d77c8
3 changed files with 6 additions and 14 deletions

View File

@ -347,9 +347,6 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
if (mShowingAddToDictionary && index == 0) {
addToDictionary(word);
} else {
if (!mSuggestions.mIsApplicationSpecifiedCompletions) {
TextEntryState.acceptedSuggestion(mSuggestions.getWord(0), word);
}
mService.pickSuggestionManually(index, word);
}
}

View File

@ -1636,6 +1636,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
TextEntryState.acceptedSuggestion(suggestions.getWord(0), suggestion);
// If this is a punctuation, apply it through the normal key press
if (suggestion.length() == 1 && (isWordSeparator(suggestion.charAt(0))
|| isSuggestedPunctuation(suggestion.charAt(0)))) {

View File

@ -24,23 +24,20 @@ import java.util.HashSet;
import java.util.List;
public class SuggestedWords {
public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, false, null);
public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, null);
public final List<CharSequence> mWords;
public final boolean mIsApplicationSpecifiedCompletions;
public final boolean mTypedWordValid;
public final boolean mHasMinimalSuggestion;
public final List<SuggestedWordInfo> mSuggestedWordInfoList;
private SuggestedWords(List<CharSequence> words, boolean isApplicationSpecifiedCompletions,
boolean typedWordValid, boolean hasMinamlSuggestion,
List<SuggestedWordInfo> suggestedWordInfoList) {
private SuggestedWords(List<CharSequence> words, boolean typedWordValid,
boolean hasMinamlSuggestion, List<SuggestedWordInfo> suggestedWordInfoList) {
if (words != null) {
mWords = words;
} else {
mWords = Collections.emptyList();
}
mIsApplicationSpecifiedCompletions = isApplicationSpecifiedCompletions;
mTypedWordValid = typedWordValid;
mHasMinimalSuggestion = hasMinamlSuggestion;
mSuggestedWordInfoList = suggestedWordInfoList;
@ -64,7 +61,6 @@ public class SuggestedWords {
public static class Builder {
private List<CharSequence> mWords = new ArrayList<CharSequence>();
private boolean mIsCompletions;
private boolean mTypedWordValid;
private boolean mHasMinimalSuggestion;
private List<SuggestedWordInfo> mSuggestedWordInfoList =
@ -109,7 +105,6 @@ public class SuggestedWords {
public Builder setApplicationSpecifiedCompletions(CompletionInfo[] infos) {
for (CompletionInfo info : infos)
addWord(info.getText());
mIsCompletions = true;
return this;
}
@ -141,15 +136,14 @@ public class SuggestedWords {
alreadySeen.add(prevWord);
}
}
mIsCompletions = false;
mTypedWordValid = false;
mHasMinimalSuggestion = false;
return this;
}
public SuggestedWords build() {
return new SuggestedWords(mWords, mIsCompletions, mTypedWordValid,
mHasMinimalSuggestion, mSuggestedWordInfoList);
return new SuggestedWords(mWords, mTypedWordValid, mHasMinimalSuggestion,
mSuggestedWordInfoList);
}
public int size() {