Tweak bottom padding for the "..." popup hint

Follow up to I45bd6edf

bug: 5255103

Change-Id: I6d5368dadbaf6c7dffadd783d8a8756fea9dbff7
main
Ken Wakasa 2011-09-07 21:56:42 +09:00
parent ed3758e33c
commit 6b97d2b9c2
4 changed files with 9 additions and 1 deletions

View File

@ -63,6 +63,8 @@
<attr name="keyLabelHorizontalPadding" format="dimension" /> <attr name="keyLabelHorizontalPadding" format="dimension" />
<!-- Top and right padding of hint letter to the edge of the key.--> <!-- Top and right padding of hint letter to the edge of the key.-->
<attr name="keyHintLetterPadding" format="dimension" /> <attr name="keyHintLetterPadding" format="dimension" />
<!-- Bottom padding of popup hint letter "..." to the edge of the key.-->
<attr name="keyPopupHintLetterPadding" format="dimension" />
<!-- Top and right padding of upper case letter to the edge of the key.--> <!-- Top and right padding of upper case letter to the edge of the key.-->
<attr name="keyUppercaseLetterPadding" format="dimension" /> <attr name="keyUppercaseLetterPadding" format="dimension" />

View File

@ -71,6 +71,7 @@
<dimen name="key_label_horizontal_padding">4dip</dimen> <dimen name="key_label_horizontal_padding">4dip</dimen>
<dimen name="key_hint_letter_padding">1dp</dimen> <dimen name="key_hint_letter_padding">1dp</dimen>
<dimen name="key_popup_hint_letter_padding">2dp</dimen>
<dimen name="key_uppercase_letter_padding">2dp</dimen> <dimen name="key_uppercase_letter_padding">2dp</dimen>
<dimen name="key_preview_height_ics">80sp</dimen> <dimen name="key_preview_height_ics">80sp</dimen>

View File

@ -52,6 +52,7 @@
<item name="keyUppercaseLetterActivatedColor">#CCE0E4E5</item> <item name="keyUppercaseLetterActivatedColor">#CCE0E4E5</item>
<item name="keyLabelHorizontalPadding">@dimen/key_label_horizontal_padding</item> <item name="keyLabelHorizontalPadding">@dimen/key_label_horizontal_padding</item>
<item name="keyHintLetterPadding">@dimen/key_hint_letter_padding</item> <item name="keyHintLetterPadding">@dimen/key_hint_letter_padding</item>
<item name="keyPopupHintLetterPadding">@dimen/key_popup_hint_letter_padding</item>
<item name="keyUppercaseLetterPadding">@dimen/key_uppercase_letter_padding</item> <item name="keyUppercaseLetterPadding">@dimen/key_uppercase_letter_padding</item>
<item name="keyPreviewLayout">@layout/key_preview</item> <item name="keyPreviewLayout">@layout/key_preview</item>
<item name="keyPreviewBackground">@drawable/keyboard_key_feedback</item> <item name="keyPreviewBackground">@drawable/keyboard_key_feedback</item>

View File

@ -58,6 +58,7 @@ import java.util.HashMap;
* @attr ref R.styleable#KeyboardView_keyHintLabelRatio * @attr ref R.styleable#KeyboardView_keyHintLabelRatio
* @attr ref R.styleable#KeyboardView_keyLabelHorizontalPadding * @attr ref R.styleable#KeyboardView_keyLabelHorizontalPadding
* @attr ref R.styleable#KeyboardView_keyHintLetterPadding * @attr ref R.styleable#KeyboardView_keyHintLetterPadding
* @attr ref R.styleable#KeyboardView_keyPopupHintLetterPadding
* @attr ref R.styleable#KeyboardView_keyUppercaseLetterPadding * @attr ref R.styleable#KeyboardView_keyUppercaseLetterPadding
* @attr ref R.styleable#KeyboardView_keyTextStyle * @attr ref R.styleable#KeyboardView_keyTextStyle
* @attr ref R.styleable#KeyboardView_keyPreviewLayout * @attr ref R.styleable#KeyboardView_keyPreviewLayout
@ -198,6 +199,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
public final Typeface mKeyTextStyle; public final Typeface mKeyTextStyle;
public final float mKeyLabelHorizontalPadding; public final float mKeyLabelHorizontalPadding;
public final float mKeyHintLetterPadding; public final float mKeyHintLetterPadding;
public final float mKeyPopupHintLetterPadding;
public final float mKeyUppercaseLetterPadding; public final float mKeyUppercaseLetterPadding;
public final int mShadowColor; public final int mShadowColor;
public final float mShadowRadius; public final float mShadowRadius;
@ -246,6 +248,8 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
R.styleable.KeyboardView_keyLabelHorizontalPadding, 0); R.styleable.KeyboardView_keyLabelHorizontalPadding, 0);
mKeyHintLetterPadding = a.getDimension( mKeyHintLetterPadding = a.getDimension(
R.styleable.KeyboardView_keyHintLetterPadding, 0); R.styleable.KeyboardView_keyHintLetterPadding, 0);
mKeyPopupHintLetterPadding = a.getDimension(
R.styleable.KeyboardView_keyPopupHintLetterPadding, 0);
mKeyUppercaseLetterPadding = a.getDimension( mKeyUppercaseLetterPadding = a.getDimension(
R.styleable.KeyboardView_keyUppercaseLetterPadding, 0); R.styleable.KeyboardView_keyUppercaseLetterPadding, 0);
mKeyTextColor = a.getColor(R.styleable.KeyboardView_keyTextColor, 0xFF000000); mKeyTextColor = a.getColor(R.styleable.KeyboardView_keyTextColor, 0xFF000000);
@ -698,7 +702,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
paint.setTextAlign(Align.CENTER); paint.setTextAlign(Align.CENTER);
final float hintX = keyWidth - params.mKeyHintLetterPadding final float hintX = keyWidth - params.mKeyHintLetterPadding
- getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint) / 2; - getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint) / 2;
final float hintY = keyHeight - params.mKeyHintLetterPadding; final float hintY = keyHeight - params.mKeyPopupHintLetterPadding;
canvas.drawText(POPUP_HINT_CHAR, hintX, hintY, paint); canvas.drawText(POPUP_HINT_CHAR, hintX, hintY, paint);
if (debugShowAlign) { if (debugShowAlign) {