aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-12-15 16:38:17 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-12-16 12:26:19 +0900
commita44685ab326809185a0e4c44afabe8fd93441b4c (patch)
tree5925b8d53cf1ee7647324d9ac26920e12b030141 /java/src/com
parente9a0efc242f3bca80e8f64523a7bade659c28069 (diff)
downloadlatinime-a44685ab326809185a0e4c44afabe8fd93441b4c.tar.gz
latinime-a44685ab326809185a0e4c44afabe8fd93441b4c.tar.xz
latinime-a44685ab326809185a0e4c44afabe8fd93441b4c.zip
Add colorValidTypedWord and alphaValidTypedWord
This change fixes Gingerbread theme. Change-Id: I142437ac0173df48ab36390f47ed67c6cea24a65
Diffstat (limited to 'java/src/com')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestionsView.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java
index 47c790093..ec0e0aece 100644
--- a/java/src/com/android/inputmethod/latin/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java
@@ -141,6 +141,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
private final List<View> mDividers;
private final List<TextView> mInfos;
+ private final int mColorValidTypedWord;
private final int mColorTypedWord;
private final int mColorAutoCorrect;
private final int mColorSuggested;
@@ -184,6 +185,8 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.SuggestionsView, defStyle, R.style.SuggestionsViewStyle);
mSuggestionStripOption = a.getInt(R.styleable.SuggestionsView_suggestionStripOption, 0);
+ final float alphaValidTypedWord = getPercent(a,
+ R.styleable.SuggestionsView_alphaValidTypedWord, 100);
final float alphaTypedWord = getPercent(a,
R.styleable.SuggestionsView_alphaTypedWord, 100);
final float alphaAutoCorrect = getPercent(a,
@@ -191,6 +194,9 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final float alphaSuggested = getPercent(a,
R.styleable.SuggestionsView_alphaSuggested, 100);
mAlphaObsoleted = getPercent(a, R.styleable.SuggestionsView_alphaSuggested, 100);
+ mColorValidTypedWord = applyAlpha(
+ a.getColor(R.styleable.SuggestionsView_colorValidTypedWord, 0),
+ alphaValidTypedWord);
mColorTypedWord = applyAlpha(
a.getColor(R.styleable.SuggestionsView_colorTypedWord, 0), alphaTypedWord);
mColorAutoCorrect = applyAlpha(
@@ -288,6 +294,8 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final int color;
if (index == mCenterSuggestionIndex && Utils.willAutoCorrect(suggestions)) {
color = mColorAutoCorrect;
+ } else if (index == mCenterSuggestionIndex && suggestions.mTypedWordValid) {
+ color = mColorValidTypedWord;
} else if (isSuggested) {
color = mColorSuggested;
} else {
@@ -423,7 +431,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final TextView word = mWords.get(index);
word.setEnabled(true);
- word.setTextColor(mColorTypedWord);
+ word.setTextColor(mColorAutoCorrect);
final CharSequence text = suggestions.getWord(index);
word.setText(text);
word.setTextScaleX(1.0f);