diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2011-06-28 16:32:39 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2011-06-29 18:34:57 +0900 |
| commit | d773bf38a3c8f49ea56de67d3b828f8126f46ed2 (patch) | |
| tree | b402a558ecf37cc1ff6f2bc584abf9a537fee5b6 /java/src/com/android/inputmethod/keyboard/Key.java | |
| parent | 98d2e4c840e7adf9d5fbb008fb3312914b1ed36b (diff) | |
Cleanup key drawing code
This change also modifies 9-patch drawables to fix the following
issues. In order to draw key background drawable just on the
coordinates we want, we have to know where an actual "visible" part is
in the drawable. The only clue we can use is "padding" of the
drawable. To achieve this, the 9-patch drawable must have its
"visible" part marked as "content". Please refer the Bug: 4948171 for
more detailed explanation.
This change also reverts the following "black" drawables back from
Gingerbread because recent change broke these (I70019a91).
* drawable-hdpi/sym_bkeyboard_*.png
* drawable-hdpi/btn_keyboard_key_*_stone.9.png
Bug: 4948171
Change-Id: I6e4d03b3144caa95c793aac97af22df34c5f454f
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/Key.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/Key.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 872fbf823..955885366 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -52,7 +52,6 @@ public class Key { public final int mLabelOption; public static final int LABEL_OPTION_ALIGN_LEFT = 0x01; public static final int LABEL_OPTION_ALIGN_RIGHT = 0x02; - public static final int LABEL_OPTION_ALIGN_BOTTOM = 0x04; public static final int LABEL_OPTION_ALIGN_LEFT_OF_CENTER = 0x08; private static final int LABEL_OPTION_LARGE_LETTER = 0x10; private static final int LABEL_OPTION_FONT_NORMAL = 0x20; @@ -276,9 +275,9 @@ public class Key { final KeyboardIconsSet iconsSet = mKeyboard.mIconsSet; mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr, - R.styleable.Keyboard_Key_visualInsetsLeft, mKeyboard.getDisplayHeight(), 0); + R.styleable.Keyboard_Key_visualInsetsLeft, keyboardWidth, 0); mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr, - R.styleable.Keyboard_Key_visualInsetsRight, mKeyboard.getDisplayHeight(), 0); + R.styleable.Keyboard_Key_visualInsetsRight, keyboardWidth, 0); mPreviewIcon = iconsSet.getIcon(style.getInt( keyAttr, R.styleable.Keyboard_Key_keyIconPreview, KeyboardIconsSet.ICON_UNDEFINED)); @@ -314,6 +313,10 @@ public class Key { } } + public CharSequence getCaseAdjustedLabel() { + return mKeyboard.adjustLabelCase(mLabel); + } + public Typeface selectTypeface(Typeface defaultTypeface) { // TODO: Handle "bold" here too? if ((mLabelOption & LABEL_OPTION_FONT_NORMAL) != 0) { |
