aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestionsView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestionsView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestionsView.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java
index c25ecb382..8c49ba0cf 100644
--- a/java/src/com/android/inputmethod/latin/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java
@@ -30,7 +30,6 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Message;
-import android.os.SystemClock;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
@@ -172,7 +171,6 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
public final TextView mWordToSaveView;
private final TextView mHintToSaveView;
- private final CharSequence mHintToSaveText;
public SuggestionsViewParams(Context context, AttributeSet attrs, int defStyle,
List<TextView> words, List<View> dividers, List<TextView> infos) {
@@ -228,7 +226,6 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final LayoutInflater inflater = LayoutInflater.from(context);
mWordToSaveView = (TextView)inflater.inflate(R.layout.suggestion_word, null);
mHintToSaveView = (TextView)inflater.inflate(R.layout.suggestion_word, null);
- mHintToSaveText = context.getText(R.string.hint_add_to_dictionary);
}
private static Drawable getMoreSuggestionsHint(Resources res, float textSize, int color) {
@@ -445,7 +442,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
}
public void layoutAddToDictionaryHint(CharSequence word, ViewGroup stripView,
- int stripWidth) {
+ int stripWidth, CharSequence hintText) {
final int width = stripWidth - mDividerWidth - mPadding * 2;
final TextView wordView = mWordToSaveView;
@@ -464,8 +461,8 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
final TextView hintView = mHintToSaveView;
hintView.setTextColor(mColorAutoCorrect);
final int hintWidth = width - wordWidth;
- final float hintScaleX = getTextScaleX(mHintToSaveText, hintWidth, hintView.getPaint());
- hintView.setText(mHintToSaveText);
+ final float hintScaleX = getTextScaleX(hintText, hintWidth, hintView.getPaint());
+ hintView.setText(hintText);
hintView.setTextScaleX(hintScaleX);
stripView.addView(hintView);
setLayoutWeight(
@@ -647,9 +644,9 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
&& mSuggestionsStrip.getChildAt(0) == mParams.mWordToSaveView;
}
- public void showAddToDictionaryHint(CharSequence word) {
+ public void showAddToDictionaryHint(CharSequence word, CharSequence hintText) {
clear();
- mParams.layoutAddToDictionaryHint(word, mSuggestionsStrip, getWidth());
+ mParams.layoutAddToDictionaryHint(word, mSuggestionsStrip, getWidth(), hintText);
}
public boolean dismissAddToDictionaryHint() {
@@ -832,8 +829,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
// Decided to be in the sliding input mode only when the touch point has been moved
// upward.
mMoreSuggestionsMode = MORE_SUGGESTIONS_IN_SLIDING_MODE;
- tracker.onShowMoreKeysPanel(
- translatedX, translatedY, SystemClock.uptimeMillis(), moreKeysPanel);
+ tracker.onShowMoreKeysPanel(translatedX, translatedY, moreKeysPanel);
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP) {
// Decided to be in the modal input mode
mMoreSuggestionsMode = MORE_SUGGESTIONS_IN_MODAL_MODE;