Skip to content
Snippets Groups Projects
Commit ef3a4564 authored by Jean Chalard's avatar Jean Chalard
Browse files

[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
parent deb5cedf
No related branches found
No related tags found
No related merge requests found
...@@ -242,8 +242,8 @@ final class SuggestionStripLayoutHelper { ...@@ -242,8 +242,8 @@ final class SuggestionStripLayoutHelper {
return indexInSuggestedWords; return indexInSuggestedWords;
} }
private int getSuggestionTextColor(final int indexInSuggestedWords, private int getSuggestionTextColor(final SuggestedWords suggestedWords,
final SuggestedWords suggestedWords) { final int indexInSuggestedWords) {
final int positionInStrip = final int positionInStrip =
getPositionInSuggestionStrip(indexInSuggestedWords, suggestedWords); getPositionInSuggestionStrip(indexInSuggestedWords, suggestedWords);
// TODO: Need to revisit this logic with bigram suggestions // TODO: Need to revisit this logic with bigram suggestions
...@@ -438,7 +438,7 @@ final class SuggestionStripLayoutHelper { ...@@ -438,7 +438,7 @@ final class SuggestionStripLayoutHelper {
// {@link SuggestionStripView#onClick(View)}. // {@link SuggestionStripView#onClick(View)}.
wordView.setTag(indexInSuggestedWords); wordView.setTag(indexInSuggestedWords);
wordView.setText(getStyledSuggestedWord(suggestedWords, indexInSuggestedWords)); wordView.setText(getStyledSuggestedWord(suggestedWords, indexInSuggestedWords));
wordView.setTextColor(getSuggestionTextColor(positionInStrip, suggestedWords)); wordView.setTextColor(getSuggestionTextColor(suggestedWords, indexInSuggestedWords));
if (SuggestionStripView.DBG) { if (SuggestionStripView.DBG) {
mDebugInfoViews.get(positionInStrip).setText( mDebugInfoViews.get(positionInStrip).setText(
suggestedWords.getDebugString(indexInSuggestedWords)); suggestedWords.getDebugString(indexInSuggestedWords));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment