aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-04-23 07:43:40 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-23 07:43:40 -0700
commit608691edb809d0f070d79aa02a1674e2a7238e52 (patch)
treef887258c36eef3805a11b18183bc24a02bbc5b9b /java
parent4849634c70f38f24ab18ca91f5be93eefdadffee (diff)
parent9dc1200b9bd29bdac1e53e26a11e5e7f78e2d364 (diff)
downloadlatinime-608691edb809d0f070d79aa02a1674e2a7238e52.tar.gz
latinime-608691edb809d0f070d79aa02a1674e2a7238e52.tar.xz
latinime-608691edb809d0f070d79aa02a1674e2a7238e52.zip
Merge "Fix key preview when shifted hint letter is activated"
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 38e6d5a1d..d5bd7fda3 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -880,18 +880,19 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
final KeyPreviewDrawParams params = mKeyPreviewDrawParams;
final int keyDrawX = key.mX + key.mVisualInsetsLeft;
final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
+ final String label = key.isShiftedLetterActivated() ? key.mHintLabel : key.mLabel;
// What we show as preview should match what we show on a key top in onBufferDraw().
- if (key.mLabel != null) {
+ if (label != null) {
// TODO Should take care of temporaryShiftLabel here.
previewText.setCompoundDrawables(null, null, null, null);
- if (StringUtils.codePointCount(key.mLabel) > 1) {
+ if (StringUtils.codePointCount(label) > 1) {
previewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, params.mKeyLetterSize);
previewText.setTypeface(Typeface.DEFAULT_BOLD);
} else {
previewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, params.mPreviewTextSize);
previewText.setTypeface(params.mKeyTextStyle);
}
- previewText.setText(key.mLabel);
+ previewText.setText(label);
} else {
previewText.setCompoundDrawables(null, null, null,
key.getPreviewIcon(mKeyboard.mIconsSet));