aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-08-29 01:54:06 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-29 01:54:06 -0700
commit387af1c370a1845860f0ad972c3bf201ae8bbd74 (patch)
tree61e44afb67c37a7b3b80feba49cb3f07b871ef7b /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
parent0223aabf20c4095bd2d328b3296c954e123ea7b9 (diff)
parent23b00b2856b50183eca44ee3f582e10950834aef (diff)
downloadlatinime-387af1c370a1845860f0ad972c3bf201ae8bbd74.tar.gz
latinime-387af1c370a1845860f0ad972c3bf201ae8bbd74.tar.xz
latinime-387af1c370a1845860f0ad972c3bf201ae8bbd74.zip
am 23b00b28: am 160dc0f9: Move resource related methods to ResourceUtils
* commit '23b00b2856b50183eca44ee3f582e10950834aef': Move resource related methods to ResourceUtils
Diffstat (limited to 'java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java19
1 files changed, 8 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index 03263d274..9e8ab81b0 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -61,6 +61,7 @@ import com.android.inputmethod.latin.AutoCorrection;
import com.android.inputmethod.latin.CollectionUtils;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.ResourceUtils;
import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.Utils;
@@ -196,15 +197,15 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
R.styleable.SuggestionStripView, defStyle, R.style.SuggestionStripViewStyle);
mSuggestionStripOption = a.getInt(
R.styleable.SuggestionStripView_suggestionStripOption, 0);
- final float alphaValidTypedWord = getFraction(a,
+ final float alphaValidTypedWord = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_alphaValidTypedWord, 1.0f);
- final float alphaTypedWord = getFraction(a,
+ final float alphaTypedWord = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_alphaTypedWord, 1.0f);
- final float alphaAutoCorrect = getFraction(a,
+ final float alphaAutoCorrect = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_alphaAutoCorrect, 1.0f);
- final float alphaSuggested = getFraction(a,
+ final float alphaSuggested = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_alphaSuggested, 1.0f);
- mAlphaObsoleted = getFraction(a,
+ mAlphaObsoleted = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_alphaSuggested, 1.0f);
mColorValidTypedWord = applyAlpha(a.getColor(
R.styleable.SuggestionStripView_colorValidTypedWord, 0), alphaValidTypedWord);
@@ -217,13 +218,13 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
mSuggestionsCountInStrip = a.getInt(
R.styleable.SuggestionStripView_suggestionsCountInStrip,
DEFAULT_SUGGESTIONS_COUNT_IN_STRIP);
- mCenterSuggestionWeight = getFraction(a,
+ mCenterSuggestionWeight = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_centerSuggestionPercentile,
DEFAULT_CENTER_SUGGESTION_PERCENTILE);
mMaxMoreSuggestionsRow = a.getInt(
R.styleable.SuggestionStripView_maxMoreSuggestionsRow,
DEFAULT_MAX_MORE_SUGGESTIONS_ROW);
- mMinMoreSuggestionsWidth = getFraction(a,
+ mMinMoreSuggestionsWidth = ResourceUtils.getFraction(a,
R.styleable.SuggestionStripView_minMoreSuggestionsWidth, 1.0f);
a.recycle();
@@ -278,10 +279,6 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
return new BitmapDrawable(res, buffer);
}
- static float getFraction(final TypedArray a, final int index, final float defValue) {
- return a.getFraction(index, 1, 1, defValue);
- }
-
private CharSequence getStyledSuggestionWord(SuggestedWords suggestedWords, int pos) {
final CharSequence word = suggestedWords.getWord(pos);
final boolean isAutoCorrect = pos == 1 && suggestedWords.willAutoCorrect();