diff options
author | 2011-12-08 00:54:57 -0800 | |
---|---|---|
committer | 2011-12-08 00:54:57 -0800 | |
commit | 3e9135d76ddf7d692f8bdba869341293fc4af515 (patch) | |
tree | fa4f3cfb4db449cebb136ce5acfa2261a2f68b7a /java/src/com/android/inputmethod/latin/SuggestionsView.java | |
parent | 684371dd332bd0fd4a8962c13dc01fecbbf4fe0f (diff) | |
parent | 9e38f9a9803b04d40c0956e5977a4fb6fce88759 (diff) | |
download | latinime-3e9135d76ddf7d692f8bdba869341293fc4af515.tar.gz latinime-3e9135d76ddf7d692f8bdba869341293fc4af515.tar.xz latinime-3e9135d76ddf7d692f8bdba869341293fc4af515.zip |
am 9e38f9a9: Merge "Use the system-wide interface to add a word."
* commit '9e38f9a9803b04d40c0956e5977a4fb6fce88759':
Use the system-wide interface to add a word.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestionsView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SuggestionsView.java | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java index 8c49ba0cf..10f5ec9db 100644 --- a/java/src/com/android/inputmethod/latin/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java @@ -672,34 +672,8 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, mPreviewPopup.dismiss(); } - private void showPreview(View view, CharSequence word) { - if (TextUtils.isEmpty(word)) - return; - - final TextView previewText = mPreviewText; - previewText.setTextColor(mParams.mColorTypedWord); - previewText.setText(word); - previewText.measure( - ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - final int[] offsetInWindow = new int[2]; - view.getLocationInWindow(offsetInWindow); - final int posX = offsetInWindow[0]; - final int posY = offsetInWindow[1] - previewText.getMeasuredHeight(); - final PopupWindow previewPopup = mPreviewPopup; - if (previewPopup.isShowing()) { - previewPopup.update(posX, posY, previewPopup.getWidth(), previewPopup.getHeight()); - } else { - previewPopup.showAtLocation(this, Gravity.NO_GRAVITY, posX, posY); - } - previewText.setVisibility(VISIBLE); - mHandler.postHidePreview(); - } - private void addToDictionary(CharSequence word) { - if (mListener.addWordToDictionary(word.toString())) { - final CharSequence message = getContext().getString(R.string.added_word, word); - showPreview(mParams.mWordToSaveView, message); - } + mListener.addWordToDictionary(word.toString()); } private final KeyboardActionListener mMoreSuggestionsListener = |