diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2011-01-01 14:07:04 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2011-01-06 22:40:20 +0900 |
| commit | cc55d947adce18f315fee80d4008965bac1b50b8 (patch) | |
| tree | 8721451a143709e951107bc1b31a71ff9436fb18 /java/src/com/android/inputmethod/keyboard/KeyboardView.java | |
| parent | ca6533214575904c66e72494cd0bddcb7c7afdaa (diff) | |
Calculate mini keyboard key width from labels
Change-Id: I4259753bd10fdf488fcffacb6b131e30511e780f
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyboardView.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardView.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index b259e0c03..e7dd716fb 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -692,7 +692,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Draw key label if (label != null) { // For characters, use large font. For labels like "Done", use small font. - final int labelSize = getLabelSizeAndSetPaint(label, key, paint); + final int labelSize = getLabelSizeAndSetPaint(label, key.mLabelOption, paint); final int labelCharHeight = getLabelCharHeight(labelSize, paint); // Vertical label text alignment. @@ -828,13 +828,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { mDirtyRect.setEmpty(); } - private int getLabelSizeAndSetPaint(CharSequence label, Key key, Paint paint) { + public int getLabelSizeAndSetPaint(CharSequence label, int keyLabelOption, Paint paint) { // For characters, use large font. For labels like "Done", use small font. final int labelSize; final Typeface labelStyle; if (label.length() > 1) { labelSize = mLabelTextSize; - if ((key.mLabelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { + if ((keyLabelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { labelStyle = Typeface.DEFAULT; } else { labelStyle = Typeface.DEFAULT_BOLD; @@ -1126,7 +1126,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Remove gesture detector on mini-keyboard miniKeyboard.mGestureDetector = null; - Keyboard keyboard = new MiniKeyboardBuilder(getContext(), popupKeyboardResId, popupKey) + Keyboard keyboard = new MiniKeyboardBuilder(this, popupKeyboardResId, popupKey) .build(); miniKeyboard.setKeyboard(keyboard); miniKeyboard.setPopupParent(this); |
