diff options
author | 2011-08-15 18:17:48 -0700 | |
---|---|---|
committer | 2011-08-15 18:17:48 -0700 | |
commit | 8f7f406c5bed8966310ba8ea6d8f93cbaa94cbd4 (patch) | |
tree | af3d72913c63e7c861468227d29a7e4023d123ae /java/src | |
parent | 3fba65bbc2177e2403535ce11118ea129d60d6dc (diff) | |
parent | 35775197aaf5fa470c0d22ca63eb9f7741b42c52 (diff) | |
download | latinime-8f7f406c5bed8966310ba8ea6d8f93cbaa94cbd4.tar.gz latinime-8f7f406c5bed8966310ba8ea6d8f93cbaa94cbd4.tar.xz latinime-8f7f406c5bed8966310ba8ea6d8f93cbaa94cbd4.zip |
Merge "Add a margin between "123" and the mic icon."
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardView.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 2df2994f6..451a9db3a 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -83,6 +83,11 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { // HORIZONTAL ELLIPSIS "...", character for popup hint. private static final String POPUP_HINT_CHAR = "\u2026"; + // Margin between the label and the icon on a key that has both of them. + // Specified by the fraction of the key width. + // TODO: Use resource parameter for this value. + private static final float LABEL_ICON_MARGIN = 0.05f; + // Main keyboard private Keyboard mKeyboard; private final KeyDrawParams mKeyDrawParams; @@ -538,11 +543,13 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { positionX = centerX - labelCharWidth * 7 / 4; paint.setTextAlign(Align.LEFT); } else if (key.hasLabelWithIconLeft() && icon != null) { - labelWidth = getLabelWidth(label, paint) + icon.getIntrinsicWidth(); + labelWidth = getLabelWidth(label, paint) + icon.getIntrinsicWidth() + + (int)(LABEL_ICON_MARGIN * keyWidth); positionX = centerX + labelWidth / 2; paint.setTextAlign(Align.RIGHT); } else if (key.hasLabelWithIconRight() && icon != null) { - labelWidth = getLabelWidth(label, paint) + icon.getIntrinsicWidth(); + labelWidth = getLabelWidth(label, paint) + icon.getIntrinsicWidth() + + (int)(LABEL_ICON_MARGIN * keyWidth); positionX = centerX - labelWidth / 2; paint.setTextAlign(Align.LEFT); } else { |