From 5d04042663054a12465a52556ba7d7cb4aacfa34 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 1 Dec 2010 12:22:19 +0900 Subject: [PATCH] Tweak tablet keyboard design This change introduces, - center align "More" key label - remove drop shadow from key label - darker key label color when manual temporary upper case - narrower pop up mini keyboard - remove unnecessary key background from pop up mini keyboard - smaller key label in portrait Bug: 3216592 Change-Id: I77e0733f467a88aa32e09fcbace56fe08f755229 --- .../btn_keyboard_key_honeycomb_popup.xml | 1 - .../keyboard_popup_honeycomb.xml | 4 +- java/res/layout/input_gingerbread.xml | 3 +- java/res/layout/input_honeycomb.xml | 6 ++- java/res/layout/input_stone_bold.xml | 3 +- java/res/values-xlarge-land/dimens.xml | 25 +++++++++ java/res/values-xlarge/dimens.xml | 10 ++-- java/res/values/attrs.xml | 11 ++-- java/res/values/dimens.xml | 4 +- java/res/values/styles.xml | 4 +- .../xml-xlarge-land/kbd_popup_template.xml | 6 +-- java/res/xml-xlarge-land/popup_domains.xml | 2 +- java/res/xml-xlarge-land/popup_smileys.xml | 2 +- java/res/xml-xlarge/kbd_phone.xml | 1 - java/res/xml-xlarge/kbd_phone_symbols.xml | 1 - java/res/xml-xlarge/kbd_popup_template.xml | 6 +-- java/res/xml-xlarge/kbd_symbols.xml | 2 - java/res/xml-xlarge/kbd_symbols_shift.xml | 2 - java/res/xml-xlarge/popup_domains.xml | 2 +- java/res/xml-xlarge/popup_smileys.xml | 2 +- .../inputmethod/latin/BaseKeyboard.java | 3 +- .../inputmethod/latin/BaseKeyboardView.java | 51 +++++++++---------- 22 files changed, 87 insertions(+), 64 deletions(-) create mode 100644 java/res/values-xlarge-land/dimens.xml diff --git a/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml b/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml index 87e952c60..6c2713650 100644 --- a/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml +++ b/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml @@ -17,5 +17,4 @@ - diff --git a/java/res/layout-xlarge/keyboard_popup_honeycomb.xml b/java/res/layout-xlarge/keyboard_popup_honeycomb.xml index 50e91f7ea..5a91dbeb0 100644 --- a/java/res/layout-xlarge/keyboard_popup_honeycomb.xml +++ b/java/res/layout-xlarge/keyboard_popup_honeycomb.xml @@ -23,8 +23,8 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:background="@drawable/keyboard_popup_panel_background_holo" - android:paddingLeft="44dip" - android:paddingRight="32dip" + android:paddingLeft="40dip" + android:paddingRight="40dip" > diff --git a/java/res/layout/input_honeycomb.xml b/java/res/layout/input_honeycomb.xml index 79eb7be96..079e70c65 100644 --- a/java/res/layout/input_honeycomb.xml +++ b/java/res/layout/input_honeycomb.xml @@ -28,10 +28,12 @@ android:paddingTop="@dimen/keyboard_top_padding" android:paddingBottom="@dimen/keyboard_bottom_padding" android:background="@drawable/keyboard_background_holo" - android:textStyle="bold" latin:keyBackground="@drawable/btn_keyboard_key_honeycomb" latin:keyPreviewLayout="@layout/key_preview_honeycomb" latin:popupLayout="@layout/keyboard_popup_honeycomb" - latin:keyTextStyle="bold" + latin:keyTextColorDisabled="#FF353535" + latin:keyLetterStyle="bold" + latin:shadowColor="#00000000" + latin:shadowRadius="0.0" /> diff --git a/java/res/layout/input_stone_bold.xml b/java/res/layout/input_stone_bold.xml index 2d4e0b205..5fb439acb 100644 --- a/java/res/layout/input_stone_bold.xml +++ b/java/res/layout/input_stone_bold.xml @@ -26,12 +26,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/keyboard_background" - android:textStyle="bold" latin:keyBackground="@drawable/btn_keyboard_key_stone" latin:keyTextColor="@color/latinkeyboard_key_color_black" latin:shadowColor="@color/latinkeyboard_key_color_white" - latin:keyTextStyle="bold" + latin:keyLetterStyle="bold" latin:colorScheme="black" latin:popupLayout="@layout/input_stone_popup" /> diff --git a/java/res/values-xlarge-land/dimens.xml b/java/res/values-xlarge-land/dimens.xml new file mode 100644 index 000000000..45d6dfa93 --- /dev/null +++ b/java/res/values-xlarge-land/dimens.xml @@ -0,0 +1,25 @@ + + + + + 18dip + + 18dip + diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml index 58fea4edf..ecf87098f 100644 --- a/java/res/values-xlarge/dimens.xml +++ b/java/res/values-xlarge/dimens.xml @@ -23,7 +23,7 @@ 13.0mm 1.5mm 2.0mm - 15.0mm + 13.0mm 1.0mm 1.0mm @@ -34,11 +34,11 @@ -13.0mm - 24dip - 18dip + 24dip + 14dip 24dip - - 18dip + + 4dip 46dip diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index ee4ec0517..ef7a968c9 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -25,8 +25,8 @@ checkable+checked+pressed. --> - - + + @@ -34,6 +34,9 @@ + + + @@ -56,10 +59,12 @@ - + + + diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index f29bc4d11..3839ff064 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -34,10 +34,10 @@ -0.325in - 0.13in + 0.13in 0.083in 40sp - + 0.13in 0.000in diff --git a/java/res/xml-xlarge-land/popup_domains.xml b/java/res/xml-xlarge-land/popup_domains.xml index 9ed79c8a5..deedba451 100644 --- a/java/res/xml-xlarge-land/popup_domains.xml +++ b/java/res/xml-xlarge-land/popup_domains.xml @@ -20,7 +20,7 @@ diff --git a/java/res/xml-xlarge/kbd_phone_symbols.xml b/java/res/xml-xlarge/kbd_phone_symbols.xml index 09eb403c8..7eadb966f 100644 --- a/java/res/xml-xlarge/kbd_phone_symbols.xml +++ b/java/res/xml-xlarge/kbd_phone_symbols.xml @@ -69,7 +69,6 @@ diff --git a/java/res/xml-xlarge/kbd_popup_template.xml b/java/res/xml-xlarge/kbd_popup_template.xml index 55ebda5e4..aa99cee03 100644 --- a/java/res/xml-xlarge/kbd_popup_template.xml +++ b/java/res/xml-xlarge/kbd_popup_template.xml @@ -19,9 +19,9 @@ --> diff --git a/java/res/xml-xlarge/kbd_symbols.xml b/java/res/xml-xlarge/kbd_symbols.xml index 7197115d6..85deb8799 100644 --- a/java/res/xml-xlarge/kbd_symbols.xml +++ b/java/res/xml-xlarge/kbd_symbols.xml @@ -124,7 +124,6 @@ > diff --git a/java/res/xml-xlarge/kbd_symbols_shift.xml b/java/res/xml-xlarge/kbd_symbols_shift.xml index 474296732..5620e1db5 100644 --- a/java/res/xml-xlarge/kbd_symbols_shift.xml +++ b/java/res/xml-xlarge/kbd_symbols_shift.xml @@ -104,7 +104,6 @@ > diff --git a/java/res/xml-xlarge/popup_domains.xml b/java/res/xml-xlarge/popup_domains.xml index d20bcb116..be0c91810 100644 --- a/java/res/xml-xlarge/popup_domains.xml +++ b/java/res/xml-xlarge/popup_domains.xml @@ -20,7 +20,7 @@ 1) drawVerticalLine(canvas, positionX, rowHeight, 0xc0008080, new Paint()); } + if (key.manualTemporaryUpperCaseHintIcon != null && isManualTemporaryUpperCase) { + paint.setColor(mKeyTextColorDisabled); + } else { + paint.setColor(mKeyTextColor); + } // Set a drop shadow for the text paint.setShadowLayer(mShadowRadius, 0, 0, mShadowColor); canvas.drawText(label, positionX, baseline, paint); @@ -892,7 +887,7 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { drawRectangle(canvas, drawableX, drawableY, drawableWidth, drawableHeight, 0x80c00000, new Paint()); } - if (key.hintIcon != null && drawHintIcon) { + if (key.hintIcon != null) { final int drawableWidth = key.width; final int drawableHeight = key.height; final int drawableX = 0; @@ -954,18 +949,20 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { private int getLabelSizeAndSetPaint(CharSequence label, Key key, Paint paint) { // For characters, use large font. For labels like "Done", use small font. final int labelSize; + final Typeface labelStyle; if (label.length() > 1 && key.codes.length < 2) { labelSize = mLabelTextSize; if ((key.labelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { - paint.setTypeface(Typeface.DEFAULT); + labelStyle = Typeface.DEFAULT; } else { - paint.setTypeface(Typeface.DEFAULT_BOLD); + labelStyle = Typeface.DEFAULT_BOLD; } } else { - labelSize = mKeyTextSize; - paint.setTypeface(mKeyTextStyle); + labelSize = mKeyLetterSize; + labelStyle = mKeyLetterStyle; } paint.setTextSize(labelSize); + paint.setTypeface(labelStyle); return labelSize; } @@ -1061,11 +1058,11 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { mPreviewText.setCompoundDrawables(null, null, null, null); mPreviewText.setText(adjustCase(tracker.getPreviewText(key))); if (key.label.length() > 1 && key.codes.length < 2) { - mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mKeyTextSize); + mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mKeyLetterSize); mPreviewText.setTypeface(Typeface.DEFAULT_BOLD); } else { mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mPreviewTextSizeLarge); - mPreviewText.setTypeface(mKeyTextStyle); + mPreviewText.setTypeface(mKeyLetterStyle); } } else { mPreviewText.setCompoundDrawables(null, null, null,