From ef3a45643e950cdd934763c59963cee4089f93e1 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 25 Feb 2014 15:49:34 +0900 Subject: [PATCH] [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 --- .../latin/suggestions/SuggestionStripLayoutHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 8ea712835..7a7464e1d 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -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));