From 61bc66b324f94a7b29b5388101cb622bf243d19e Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 29 Aug 2012 22:34:29 +0900 Subject: [PATCH] Revert "Revert "Fix key letter size of 5-rows Thai keyboard"" This reverts commit 7a5ca9982fae2c17df4e597d2c54c81782946ed1. Depends: Ia4fa5046b3106e2710b9d5df1a6cc5f2cf995ec7 Change-Id: I0b9d0125380efe898943dc26ae884378145c44a3 --- java/res/values-land/dimens.xml | 2 + java/res/values-sw600dp-land/dimens.xml | 2 + java/res/values-sw600dp/dimens.xml | 2 + java/res/values-sw768dp-land/dimens.xml | 2 + java/res/values-sw768dp/dimens.xml | 2 + java/res/values/dimens.xml | 2 + java/res/xml-sw600dp-land/kbd_thai.xml | 2 + java/res/xml-sw600dp/kbd_thai.xml | 2 + java/res/xml-sw768dp-land/kbd_thai.xml | 2 + java/res/xml-sw768dp/kbd_thai.xml | 2 + .../inputmethod/keyboard/Keyboard.java | 20 ++++++ .../inputmethod/keyboard/KeyboardView.java | 69 +++++++++++++------ .../inputmethod/latin/ResourceUtils.java | 10 +++ 13 files changed, 97 insertions(+), 22 deletions(-) diff --git a/java/res/values-land/dimens.xml b/java/res/values-land/dimens.xml index 62597258c..fbfbb512c 100644 --- a/java/res/values-land/dimens.xml +++ b/java/res/values-land/dimens.xml @@ -53,6 +53,8 @@ 40% 90% 40.000% + 78% + 48% 0.0dp 1.6dp diff --git a/java/res/values-sw600dp-land/dimens.xml b/java/res/values-sw600dp-land/dimens.xml index a478df89a..8283cd9fb 100644 --- a/java/res/values-sw600dp-land/dimens.xml +++ b/java/res/values-sw600dp-land/dimens.xml @@ -51,6 +51,8 @@ 34% 29% 30.0% + 62% + 36% 4dp 252.0dp diff --git a/java/res/values-sw600dp/dimens.xml b/java/res/values-sw600dp/dimens.xml index 5596ba41c..78aa60533 100644 --- a/java/res/values-sw600dp/dimens.xml +++ b/java/res/values-sw600dp/dimens.xml @@ -63,6 +63,8 @@ 22% 50% 28.0% + 52% + 27% 94.5dp 16.0dp diff --git a/java/res/values-sw768dp-land/dimens.xml b/java/res/values-sw768dp-land/dimens.xml index b95c858dc..ac94c9293 100644 --- a/java/res/values-sw768dp-land/dimens.xml +++ b/java/res/values-sw768dp-land/dimens.xml @@ -53,6 +53,8 @@ 28% 24% 24.00% + 53% + 30% 107.1dp 8.0dp diff --git a/java/res/values-sw768dp/dimens.xml b/java/res/values-sw768dp/dimens.xml index ce33b73cb..0fd9cedcb 100644 --- a/java/res/values-sw768dp/dimens.xml +++ b/java/res/values-sw768dp/dimens.xml @@ -64,6 +64,8 @@ 26% 50% 29.03% + 51% + 33% 94.5dp 16.0dp diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 4fd942b14..e0fcd5e2d 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -65,6 +65,8 @@ 35% 82% 33.735% + 64% + 41% 80dp -8.0dp diff --git a/java/res/xml-sw600dp-land/kbd_thai.xml b/java/res/xml-sw600dp-land/kbd_thai.xml index 314306140..a7763f2c7 100644 --- a/java/res/xml-sw600dp-land/kbd_thai.xml +++ b/java/res/xml-sw600dp-land/kbd_thai.xml @@ -23,6 +23,8 @@ latin:rowHeight="20%p" latin:verticalGap="3.20%p" latin:keyTypeface="normal" + latin:keyLetterSize="@fraction/key_letter_ratio_5rows" + latin:keyShiftedLetterHintRatio="@fraction/key_uppercase_letter_ratio_5rows" latin:touchPositionCorrectionData="@null" > = 0.0f; } + // {@link Resources#getDimensionPixelSize(int)} returns at least one pixel size. + public static boolean isValidDimensionPixelSize(final int dimension) { + return dimension > 0; + } + + // {@link Resources#getDimensionPixelOffset(int)} may return zero pixel offset. + public static boolean isValidDimensionPixelOffset(final int dimension) { + return dimension >= 0; + } + public static float getFraction(final TypedArray a, final int index, final float defValue) { final TypedValue value = a.peekValue(index); if (value == null || !isFractionValue(value)) {