diff options
author | 2011-01-19 01:05:39 -0800 | |
---|---|---|
committer | 2011-01-19 01:05:39 -0800 | |
commit | 1e6d39104814083011d556376974f241e51a8bed (patch) | |
tree | 77d28d5c4c37f246d329c2e2f5ca033e43cafd11 /java/src/com/android/inputmethod/latin/CandidateView.java | |
parent | 53746972d0dda9cbbf3d49cfa71271eaeb5cfe5b (diff) | |
parent | ce4b2d2daba8005c2c07a995c8a145ee812f56ff (diff) | |
download | latinime-1e6d39104814083011d556376974f241e51a8bed.tar.gz latinime-1e6d39104814083011d556376974f241e51a8bed.tar.xz latinime-1e6d39104814083011d556376974f241e51a8bed.zip |
am ce4b2d2d: Merge "Add a safety net for auto-correction." into honeycomb
* commit 'ce4b2d2daba8005c2c07a995c8a145ee812f56ff':
Add a safety net for auto-correction.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/CandidateView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/CandidateView.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 30f4a59f9..d2d1f22dd 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -45,23 +45,22 @@ import android.widget.TextView; import java.util.ArrayList; public class CandidateView extends LinearLayout implements OnClickListener, OnLongClickListener { - private LatinIME mService; - private final ArrayList<View> mWords = new ArrayList<View>(); - private final TextView mPreviewText; - private final PopupWindow mPreviewPopup; - + private static final CharacterStyle BOLD_SPAN = new StyleSpan(Typeface.BOLD); + private static final CharacterStyle UNDERLINE_SPAN = new UnderlineSpan(); private static final int MAX_SUGGESTIONS = 16; + private final ArrayList<View> mWords = new ArrayList<View>(); private final boolean mConfigCandidateHighlightFontColorEnabled; + private final CharacterStyle mInvertedForegroundColorSpan; + private final CharacterStyle mInvertedBackgroundColorSpan; private final int mColorNormal; private final int mColorRecommended; private final int mColorOther; - private static final CharacterStyle BOLD_SPAN = new StyleSpan(Typeface.BOLD); - private static final CharacterStyle UNDERLINE_SPAN = new UnderlineSpan(); - private final CharacterStyle mInvertedForegroundColorSpan; - private final CharacterStyle mInvertedBackgroundColorSpan; + private final PopupWindow mPreviewPopup; + private final TextView mPreviewText; + private LatinIME mService; private SuggestedWords mSuggestions = SuggestedWords.EMPTY; private boolean mShowingAutoCorrectionInverted; private boolean mShowingAddToDictionary; @@ -186,9 +185,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo final TextView tv = (TextView)v.findViewById(R.id.candidate_word); final TextView dv = (TextView)v.findViewById(R.id.candidate_debug_info); tv.setTextColor(mColorNormal); + // TODO: Needs safety net? if (suggestions.mHasMinimalSuggestion - && ((i == 1 && !suggestions.mTypedWordValid) || - (i == 0 && suggestions.mTypedWordValid))) { + && ((i == 1 && !suggestions.mTypedWordValid) + || (i == 0 && suggestions.mTypedWordValid))) { final CharacterStyle style; if (mConfigCandidateHighlightFontColorEnabled) { style = BOLD_SPAN; @@ -329,7 +329,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo mService.pickSuggestionManually(index, word); } } - + @Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); |