am 783f1932: [QRP4] Simplification & small correctness fix.

* commit '783f1932393547b2bcb88e6dc454ce888ce1d4a1':
  [QRP4] Simplification & small correctness fix.
main
Jean Chalard 2014-02-25 01:58:43 -08:00 committed by Android Git Automerger
commit 9f5acd4ede
1 changed files with 6 additions and 6 deletions

View File

@ -248,18 +248,18 @@ final class SuggestionStripLayoutHelper {
final int indexInSuggestedWords) { final int indexInSuggestedWords) {
final int positionInStrip = final int positionInStrip =
getPositionInSuggestionStrip(indexInSuggestedWords, suggestedWords); getPositionInSuggestionStrip(indexInSuggestedWords, suggestedWords);
// TODO: Need to revisit this logic with bigram suggestions final boolean isTypedWord = !suggestedWords.mIsPrediction
final boolean isSuggested = (indexInSuggestedWords != SuggestedWords.INDEX_OF_TYPED_WORD); && (indexInSuggestedWords == SuggestedWords.INDEX_OF_TYPED_WORD);
final int color; final int color;
if (positionInStrip == mCenterPositionInStrip && suggestedWords.mWillAutoCorrect) { if (positionInStrip == mCenterPositionInStrip && suggestedWords.mWillAutoCorrect) {
color = mColorAutoCorrect; color = mColorAutoCorrect;
} else if (positionInStrip == mCenterPositionInStrip && suggestedWords.mTypedWordValid) { } else if (positionInStrip == mCenterPositionInStrip && suggestedWords.mTypedWordValid) {
color = mColorValidTypedWord; color = mColorValidTypedWord;
} else if (isSuggested) { } else if (isTypedWord) {
color = mColorSuggested;
} else {
color = mColorTypedWord; color = mColorTypedWord;
} else {
color = mColorSuggested;
} }
if (LatinImeLogger.sDBG && suggestedWords.size() > 1) { if (LatinImeLogger.sDBG && suggestedWords.size() > 1) {
// If we auto-correct, then the autocorrection is in slot 0 and the typed word // If we auto-correct, then the autocorrection is in slot 0 and the typed word
@ -272,7 +272,7 @@ final class SuggestionStripLayoutHelper {
} }
} }
if (suggestedWords.mIsObsoleteSuggestions && isSuggested) { if (suggestedWords.mIsObsoleteSuggestions && !isTypedWord) {
return applyAlpha(color, mAlphaObsoleted); return applyAlpha(color, mAlphaObsoleted);
} }
return color; return color;