Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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));