diff options
author | 2011-01-19 01:08:00 -0800 | |
---|---|---|
committer | 2011-01-19 01:08:00 -0800 | |
commit | 029511cc04fc6c3b7d6657fa728be7ffa8b411e7 (patch) | |
tree | 77d28d5c4c37f246d329c2e2f5ca033e43cafd11 /java/src/com/android/inputmethod/latin/CandidateView.java | |
parent | c11184638e9bd4cb2d04df05aad158c58484ac1e (diff) | |
parent | 1e6d39104814083011d556376974f241e51a8bed (diff) | |
download | latinime-029511cc04fc6c3b7d6657fa728be7ffa8b411e7.tar.gz latinime-029511cc04fc6c3b7d6657fa728be7ffa8b411e7.tar.xz latinime-029511cc04fc6c3b7d6657fa728be7ffa8b411e7.zip |
am 1e6d3910: am ce4b2d2d: Merge "Add a safety net for auto-correction." into honeycomb
* commit '1e6d39104814083011d556376974f241e51a8bed':
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(); |