[QRP1] Fix a bug where the wrong value would get passed

In the practice it works because this never tries to access
inside the suggestion strip, and the worst that can happen
is a wrong text color for a suggestion. But since the two
colors that would be swapped are the same, nobody ever
notices -- unless they are using the GingerBread theme.

Change-Id: Ic8c70d8b3cdddf92946dfefbbc6d061572626c7a
main
Jean Chalard 2014-02-25 15:49:34 +09:00
parent deb5cedf81
commit ef3a45643e
1 changed files with 3 additions and 3 deletions

View File

@ -242,8 +242,8 @@ final class SuggestionStripLayoutHelper {
return indexInSuggestedWords;
}
private int getSuggestionTextColor(final int indexInSuggestedWords,
final SuggestedWords suggestedWords) {
private int getSuggestionTextColor(final SuggestedWords suggestedWords,
final int indexInSuggestedWords) {
final int positionInStrip =
getPositionInSuggestionStrip(indexInSuggestedWords, suggestedWords);
// TODO: Need to revisit this logic with bigram suggestions
@ -438,7 +438,7 @@ final class SuggestionStripLayoutHelper {
// {@link SuggestionStripView#onClick(View)}.
wordView.setTag(indexInSuggestedWords);
wordView.setText(getStyledSuggestedWord(suggestedWords, indexInSuggestedWords));
wordView.setTextColor(getSuggestionTextColor(positionInStrip, suggestedWords));
wordView.setTextColor(getSuggestionTextColor(suggestedWords, indexInSuggestedWords));
if (SuggestionStripView.DBG) {
mDebugInfoViews.get(positionInStrip).setText(
suggestedWords.getDebugString(indexInSuggestedWords));