diff options
author | 2011-11-02 11:00:45 +0900 | |
---|---|---|
committer | 2011-11-04 10:35:06 +0900 | |
commit | 80e9bd34d19e37c0cea7d2c42d8fea3ff0c56c32 (patch) | |
tree | 7604290741de48a3a9db3ccaa4416e896b419c19 /java/src/com/android/inputmethod | |
parent | d4eaa1bc322ecbdd692f35babc3e3b650d2c2913 (diff) | |
download | latinime-80e9bd34d19e37c0cea7d2c42d8fea3ff0c56c32.tar.gz latinime-80e9bd34d19e37c0cea7d2c42d8fea3ff0c56c32.tar.xz latinime-80e9bd34d19e37c0cea7d2c42d8fea3ff0c56c32.zip |
Do not clip the popup key preview even if there is no left/right preview icons
Change-Id: Ie51f56c64ba4c69400fe6472b2397ba19ee74911
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardView.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 04e672590..3ce184941 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -906,12 +906,16 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { int previewX = keyDrawX - (previewWidth - keyDrawWidth) / 2 + params.mCoordinates[0]; final int previewY = key.mY - previewHeight + params.mCoordinates[1] + params.mPreviewOffset; - if (previewX < 0 && params.mPreviewLeftBackground != null) { - previewText.setBackgroundDrawable(params.mPreviewLeftBackground); + if (previewX < 0) { previewX = 0; - } else if (previewX + previewWidth > getWidth() && params.mPreviewRightBackground != null) { - previewText.setBackgroundDrawable(params.mPreviewRightBackground); + if (params.mPreviewLeftBackground != null) { + previewText.setBackgroundDrawable(params.mPreviewLeftBackground); + } + } else if (previewX > getWidth() - previewWidth) { previewX = getWidth() - previewWidth; + if (params.mPreviewRightBackground != null) { + previewText.setBackgroundDrawable(params.mPreviewRightBackground); + } } // Set the preview background state |