From ab5f9532dbd1ac0469cab32cf97d87f25f45d8b0 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 3 Sep 2012 11:26:45 +0900 Subject: [PATCH] Use 5-row layout for Thai phone keybopard Bug: 6911182 Change-Id: I78f59564e8c31b9b66ed9a136584d0c57cc43120 --- java/res/xml-sw600dp/kbd_thai.xml | 31 --- java/res/xml-sw600dp/rowkeys_thai1.xml | 130 ------------- java/res/xml-sw600dp/rowkeys_thai2.xml | 148 --------------- java/res/xml-sw600dp/rowkeys_thai3.xml | 134 ------------- java/res/xml-sw600dp/rows_thai.xml | 9 +- java/res/xml-sw768dp-land/kbd_thai.xml | 31 --- .../res/xml-sw768dp-land/kbd_thai_symbols.xml | 31 --- .../kbd_thai_symbols_shift.xml | 31 --- java/res/xml-sw768dp/kbd_thai.xml | 31 --- java/res/xml-sw768dp/rows_thai.xml | 6 +- java/res/xml/kbd_thai.xml | 5 + .../key_thai_kho_khuat.xml} | 27 ++- java/res/xml/rowkeys_thai1.xml | 144 +++++++------- java/res/xml/rowkeys_thai2.xml | 179 ++++++++++-------- java/res/xml/rowkeys_thai3.xml | 109 +++++++---- .../{xml-sw600dp => xml}/rowkeys_thai4.xml | 0 java/res/xml/rows_thai.xml | 27 +-- .../inputmethod/keyboard/KeyboardView.java | 2 +- 18 files changed, 277 insertions(+), 798 deletions(-) delete mode 100644 java/res/xml-sw600dp/kbd_thai.xml delete mode 100644 java/res/xml-sw600dp/rowkeys_thai1.xml delete mode 100644 java/res/xml-sw600dp/rowkeys_thai2.xml delete mode 100644 java/res/xml-sw600dp/rowkeys_thai3.xml delete mode 100644 java/res/xml-sw768dp-land/kbd_thai.xml delete mode 100644 java/res/xml-sw768dp-land/kbd_thai_symbols.xml delete mode 100644 java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml delete mode 100644 java/res/xml-sw768dp/kbd_thai.xml rename java/res/{xml-sw600dp-land/kbd_thai.xml => xml/key_thai_kho_khuat.xml} (56%) rename java/res/{xml-sw600dp => xml}/rowkeys_thai4.xml (100%) diff --git a/java/res/xml-sw600dp/kbd_thai.xml b/java/res/xml-sw600dp/kbd_thai.xml deleted file mode 100644 index b4a4a0b92..000000000 --- a/java/res/xml-sw600dp/kbd_thai.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/java/res/xml-sw600dp/rowkeys_thai1.xml b/java/res/xml-sw600dp/rowkeys_thai1.xml deleted file mode 100644 index 842bf05ee..000000000 --- a/java/res/xml-sw600dp/rowkeys_thai1.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml-sw600dp/rowkeys_thai2.xml b/java/res/xml-sw600dp/rowkeys_thai2.xml deleted file mode 100644 index 71ab2c9df..000000000 --- a/java/res/xml-sw600dp/rowkeys_thai2.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml-sw600dp/rowkeys_thai3.xml b/java/res/xml-sw600dp/rowkeys_thai3.xml deleted file mode 100644 index b9d1475ab..000000000 --- a/java/res/xml-sw600dp/rowkeys_thai3.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml-sw600dp/rows_thai.xml b/java/res/xml-sw600dp/rows_thai.xml index c1fe55b39..bc89640ac 100644 --- a/java/res/xml-sw600dp/rows_thai.xml +++ b/java/res/xml-sw600dp/rows_thai.xml @@ -27,8 +27,7 @@ latin:keyWidth="7.5%p" > + latin:keyboardLayout="@xml/rowkeys_thai1" /> @@ -38,14 +37,16 @@ > + latin:keyXPos="2.5%p" /> + + latin:keyXPos="5.0%p" /> diff --git a/java/res/xml-sw768dp-land/kbd_thai.xml b/java/res/xml-sw768dp-land/kbd_thai.xml deleted file mode 100644 index b4a4a0b92..000000000 --- a/java/res/xml-sw768dp-land/kbd_thai.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/java/res/xml-sw768dp-land/kbd_thai_symbols.xml b/java/res/xml-sw768dp-land/kbd_thai_symbols.xml deleted file mode 100644 index 0cd9a61ea..000000000 --- a/java/res/xml-sw768dp-land/kbd_thai_symbols.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml b/java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml deleted file mode 100644 index a68fec458..000000000 --- a/java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/java/res/xml-sw768dp/kbd_thai.xml b/java/res/xml-sw768dp/kbd_thai.xml deleted file mode 100644 index b4a4a0b92..000000000 --- a/java/res/xml-sw768dp/kbd_thai.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/java/res/xml-sw768dp/rows_thai.xml b/java/res/xml-sw768dp/rows_thai.xml index 7721bc5a9..5f9b383f8 100644 --- a/java/res/xml-sw768dp/rows_thai.xml +++ b/java/res/xml-sw768dp/rows_thai.xml @@ -28,7 +28,7 @@ > + latin:keyXPos="3.799%p" /> @@ -42,9 +42,11 @@ latin:keyWidth="7.969%p" /> + diff --git a/java/res/xml-sw600dp-land/kbd_thai.xml b/java/res/xml/key_thai_kho_khuat.xml similarity index 56% rename from java/res/xml-sw600dp-land/kbd_thai.xml rename to java/res/xml/key_thai_kho_khuat.xml index b4a4a0b92..0ffd0f924 100644 --- a/java/res/xml-sw600dp-land/kbd_thai.xml +++ b/java/res/xml/key_thai_kho_khuat.xml @@ -18,14 +18,23 @@ */ --> - - - + + + + + + + + + + + diff --git a/java/res/xml/rowkeys_thai1.xml b/java/res/xml/rowkeys_thai1.xml index e175befb3..950d2a456 100644 --- a/java/res/xml/rowkeys_thai1.xml +++ b/java/res/xml/rowkeys_thai1.xml @@ -25,119 +25,109 @@ - - - - - - - - - - - - - - - - + latin:keyLabel="+" /> + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - diff --git a/java/res/xml/rowkeys_thai2.xml b/java/res/xml/rowkeys_thai2.xml index f5fd405e4..f602994b9 100644 --- a/java/res/xml/rowkeys_thai2.xml +++ b/java/res/xml/rowkeys_thai2.xml @@ -25,105 +25,116 @@ - + - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + U+0E4D: " ํ" THAI CHARACTER THANTHAKHAT --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rowkeys_thai3.xml b/java/res/xml/rowkeys_thai3.xml index 2fcc0068a..7b6e6372e 100644 --- a/java/res/xml/rowkeys_thai3.xml +++ b/java/res/xml/rowkeys_thai3.xml @@ -25,37 +25,26 @@ - + - + - + - + - + - - - + + + + + + + + + - + - + - + - + - + - - + U+0E49: " ้" THAI CHARACTER MAI THO --> + + + + + + + + + + + diff --git a/java/res/xml-sw600dp/rowkeys_thai4.xml b/java/res/xml/rowkeys_thai4.xml similarity index 100% rename from java/res/xml-sw600dp/rowkeys_thai4.xml rename to java/res/xml/rowkeys_thai4.xml diff --git a/java/res/xml/rows_thai.xml b/java/res/xml/rows_thai.xml index 6b80df640..108b7e1fc 100644 --- a/java/res/xml/rows_thai.xml +++ b/java/res/xml/rows_thai.xml @@ -24,31 +24,34 @@ + latin:keyboardLayout="@xml/rowkeys_thai2" /> - + + + + latin:keyStyle="shiftKeyStyle" /> + + diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 0b4d70632..5b02f9f5a 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -647,7 +647,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { // Draw key icon. if (key.mLabel == null && icon != null) { - final int iconWidth = icon.getIntrinsicWidth(); + final int iconWidth = Math.min(icon.getIntrinsicWidth(), keyWidth); final int iconHeight = icon.getIntrinsicHeight(); final int iconX, alignX; final int iconY = (keyHeight - iconHeight) / 2;