diff options
author | 2011-12-07 15:53:37 +0900 | |
---|---|---|
committer | 2011-12-07 16:19:05 +0900 | |
commit | 361c42b746e220738d29700698c241aab33e9511 (patch) | |
tree | 4ef9b2e949ee90569f31c413c1eddbfc17c7a5c8 /java/src/com/android/inputmethod/latin/SuggestionsView.java | |
parent | 55c0198eee18dfa4ec750d23fc589bced289d23c (diff) | |
download | latinime-361c42b746e220738d29700698c241aab33e9511.tar.gz latinime-361c42b746e220738d29700698c241aab33e9511.tar.xz latinime-361c42b746e220738d29700698c241aab33e9511.zip |
Use the system-wide interface to add a word.
Bug: 5306641
Change-Id: Ic87e5bc3a5f1f03c57d48f2d92c28e0aba06847d
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 = |