aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png (renamed from java/res/drawable-hdpi/btn_keyboard_key_popup_background_holo.9.png)bin856 -> 856 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_popup_panel_background_holo.9.png (renamed from java/res/drawable-mdpi/btn_keyboard_key_popup_background_holo.9.png)bin571 -> 571 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_popup_panel_background_holo.9.png (renamed from java/res/drawable-xhdpi/btn_keyboard_key_popup_background_holo.9.png)bin1178 -> 1178 bytes
-rw-r--r--java/res/values/attrs.xml8
-rw-r--r--java/res/values/dimens.xml2
-rw-r--r--java/res/values/styles.xml34
-rw-r--r--java/res/values/themes-basic-highcontrast.xml1
-rw-r--r--java/res/values/themes-basic.xml1
-rw-r--r--java/res/values/themes-gingerbread.xml1
-rw-r--r--java/res/values/themes-ics.xml1
-rw-r--r--java/res/values/themes-stone-bold.xml1
-rw-r--r--java/res/values/themes-stone.xml1
-rw-r--r--java/res/xml/kbd_mini_keyboard_template.xml1
-rw-r--r--java/src/com/android/inputmethod/keyboard/MiniKeyboard.java21
14 files changed, 52 insertions, 20 deletions
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_popup_background_holo.9.png b/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png
index 53d7b6fb3..53d7b6fb3 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_popup_background_holo.9.png
+++ b/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/btn_keyboard_key_popup_background_holo.9.png b/java/res/drawable-mdpi/keyboard_popup_panel_background_holo.9.png
index 61988a8e1..61988a8e1 100644
--- a/java/res/drawable-mdpi/btn_keyboard_key_popup_background_holo.9.png
+++ b/java/res/drawable-mdpi/keyboard_popup_panel_background_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_popup_background_holo.9.png b/java/res/drawable-xhdpi/keyboard_popup_panel_background_holo.9.png
index 1dee699f4..1dee699f4 100644
--- a/java/res/drawable-xhdpi/btn_keyboard_key_popup_background_holo.9.png
+++ b/java/res/drawable-xhdpi/keyboard_popup_panel_background_holo.9.png
Binary files differ
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 20f1e32c8..e964889c4 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -22,6 +22,8 @@
<attr name="latinKeyboardStyle" format="reference" />
<!-- KeyboardView style -->
<attr name="keyboardViewStyle" format="reference" />
+ <!-- MiniKeyboard style -->
+ <attr name="miniKeyboardStyle" format="reference" />
<!-- MiniKeyboardView style -->
<attr name="miniKeyboardViewStyle" format="reference" />
<attr name="miniKeyboardPanelStyle" format="reference" />
@@ -130,15 +132,15 @@
<declare-styleable name="Keyboard">
<!-- Default keyboard height -->
- <attr name="keyboardHeight" format="dimension" />
+ <attr name="keyboardHeight" format="dimension|fraction" />
<!-- Maximum keyboard height, in pixels or percentage of display height -->
<attr name="maxKeyboardHeight" format="dimension|fraction" />
<!-- Minimum keyboard height represented in pixels, percentage of display height if fraction
is positive, or percentage of display width if fraction is negative. -->
<attr name="minKeyboardHeight" format="dimension|fraction" />
<!-- Keyboard top and bottom paddings. -->
- <attr name="keyboardTopPadding" format="dimension" />
- <attr name="keyboardBottomPadding" format="dimension" />
+ <attr name="keyboardTopPadding" format="dimension|fraction" />
+ <attr name="keyboardBottomPadding" format="dimension|fraction" />
<!-- Default width of a key, in pixels or percentage of display width.
If the value is zero, the actual key width will be determined to fill out the area up
to the right edge of the keyboard.
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index e75347442..a0ab69528 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -48,7 +48,7 @@
<fraction name="keyboard_bottom_padding_ics">4.669%p</fraction>
<fraction name="key_bottom_gap_ics">6.127%p</fraction>
<fraction name="key_horizontal_gap_ics">1.739%p</fraction>
- <dimen name="mini_keyboard_horizontal_edges_padding_ics">6dp</dimen>
+ <dimen name="mini_keyboard_horizontal_edges_padding_ics">4dip</dimen>
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
<!-- popup_key_height x 1.2 -->
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index dc2021a44..0e8216b48 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -68,6 +68,14 @@
<item name="backgroundDimAmount">0.5</item>
</style>
<style
+ name="MiniKeyboard"
+ parent="Keyboard"
+ >
+ <item name="keyboardTopPadding">0dip</item>
+ <item name="keyboardBottomPadding">0dip</item>
+ <item name="horizontalGap">0dip</item>
+ </style>
+ <style
name="MiniKeyboardView"
parent="KeyboardView"
>
@@ -146,6 +154,14 @@
<item name="shadowColor">#FFFFFFFF</item>
</style>
<style
+ name="MiniKeyboard.Stone"
+ parent="Keyboard.Stone"
+ >
+ <item name="keyboardTopPadding">0dip</item>
+ <item name="keyboardBottomPadding">0dip</item>
+ <item name="horizontalGap">0dip</item>
+ </style>
+ <style
name="MiniKeyboardView.Stone"
parent="MiniKeyboardView"
>
@@ -177,6 +193,14 @@
<item name="keyTextStyle">bold</item>
</style>
<style
+ name="MiniKeyboard.Gingerbread"
+ parent="Keyboard.Gingerbread"
+ >
+ <item name="keyboardTopPadding">0dip</item>
+ <item name="keyboardBottomPadding">0dip</item>
+ <item name="horizontalGap">0dip</item>
+ </style>
+ <style
name="MiniKeyboardView.Gingerbread"
parent="MiniKeyboardView"
>
@@ -220,6 +244,14 @@
<item name="shadowRadius">0.0</item>
</style>
<style
+ name="MiniKeyboard.IceCreamSandwich"
+ parent="Keyboard.IceCreamSandwich"
+ >
+ <item name="keyboardTopPadding">0dip</item>
+ <item name="keyboardBottomPadding">0dip</item>
+ <item name="horizontalGap">0dip</item>
+ </style>
+ <style
name="MiniKeyboardView.IceCreamSandwich"
parent="MiniKeyboardView"
>
@@ -227,7 +259,7 @@
<item name="keyBackground">@drawable/btn_keyboard_key_popup_ics</item>
</style>
<style name="MiniKeyboardPanelStyle.IceCreamSandwich">
- <item name="android:background">@drawable/btn_keyboard_key_popup_background_holo</item>
+ <item name="android:background">@drawable/keyboard_popup_panel_background_holo</item>
<item name="android:paddingLeft">@dimen/mini_keyboard_horizontal_edges_padding_ics</item>
<item name="android:paddingRight">@dimen/mini_keyboard_horizontal_edges_padding_ics</item>
</style>
diff --git a/java/res/values/themes-basic-highcontrast.xml b/java/res/values/themes-basic-highcontrast.xml
index a45fa5239..ce0598042 100644
--- a/java/res/values/themes-basic-highcontrast.xml
+++ b/java/res/values/themes-basic-highcontrast.xml
@@ -19,6 +19,7 @@
<item name="keyboardStyle">@style/Keyboard</item>
<item name="latinKeyboardStyle">@style/LatinKeyboard</item>
<item name="keyboardViewStyle">@style/KeyboardView.HighContrast</item>
+ <item name="miniKeyboardStyle">@style/MiniKeyboard</item>
<item name="miniKeyboardViewStyle">@style/MiniKeyboardView</item>
<item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item>
<item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item>
diff --git a/java/res/values/themes-basic.xml b/java/res/values/themes-basic.xml
index 4f754844f..ff9fed55f 100644
--- a/java/res/values/themes-basic.xml
+++ b/java/res/values/themes-basic.xml
@@ -19,6 +19,7 @@
<item name="keyboardStyle">@style/Keyboard</item>
<item name="latinKeyboardStyle">@style/LatinKeyboard</item>
<item name="keyboardViewStyle">@style/KeyboardView</item>
+ <item name="miniKeyboardStyle">@style/MiniKeyboard</item>
<item name="miniKeyboardViewStyle">@style/MiniKeyboardView</item>
<item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item>
<item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item>
diff --git a/java/res/values/themes-gingerbread.xml b/java/res/values/themes-gingerbread.xml
index f3a74f33e..be853eb0f 100644
--- a/java/res/values/themes-gingerbread.xml
+++ b/java/res/values/themes-gingerbread.xml
@@ -19,6 +19,7 @@
<item name="keyboardStyle">@style/Keyboard.Gingerbread</item>
<item name="latinKeyboardStyle">@style/LatinKeyboard</item>
<item name="keyboardViewStyle">@style/KeyboardView.Gingerbread</item>
+ <item name="miniKeyboardStyle">@style/MiniKeyboard.Gingerbread</item>
<item name="miniKeyboardViewStyle">@style/MiniKeyboardView.Gingerbread</item>
<item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item>
<item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item>
diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml
index 4b5ae6d20..618aaed79 100644
--- a/java/res/values/themes-ics.xml
+++ b/java/res/values/themes-ics.xml
@@ -19,6 +19,7 @@
<item name="keyboardStyle">@style/Keyboard.IceCreamSandwich</item>
<item name="latinKeyboardStyle">@style/LatinKeyboard.IceCreamSandwich</item>
<item name="keyboardViewStyle">@style/KeyboardView.IceCreamSandwich</item>
+ <item name="miniKeyboardStyle">@style/MiniKeyboard.IceCreamSandwich</item>
<item name="miniKeyboardViewStyle">@style/MiniKeyboardView.IceCreamSandwich</item>
<item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle.IceCreamSandwich</item>
<item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle.IceCreamSandwich</item>
diff --git a/java/res/values/themes-stone-bold.xml b/java/res/values/themes-stone-bold.xml
index 3cff0f123..fdf9c51f5 100644
--- a/java/res/values/themes-stone-bold.xml
+++ b/java/res/values/themes-stone-bold.xml
@@ -19,6 +19,7 @@
<item name="keyboardStyle">@style/Keyboard.Stone</item>
<item name="latinKeyboardStyle">@style/LatinKeyboard.Stone</item>
<item name="keyboardViewStyle">@style/KeyboardView.Stone.Bold</item>
+ <item name="miniKeyboardStyle">@style/MiniKeyboard.Stone</item>
<item name="miniKeyboardViewStyle">@style/MiniKeyboardView.Stone</item>
<item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item>
<item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item>
diff --git a/java/res/values/themes-stone.xml b/java/res/values/themes-stone.xml
index 785f4107f..cb3edc58f 100644
--- a/java/res/values/themes-stone.xml
+++ b/java/res/values/themes-stone.xml
@@ -19,6 +19,7 @@
<item name="keyboardStyle">@style/Keyboard.Stone</item>
<item name="latinKeyboardStyle">@style/LatinKeyboard.Stone</item>
<item name="keyboardViewStyle">@style/KeyboardView.Stone</item>
+ <item name="miniKeyboardStyle">@style/MiniKeyboard.Stone</item>
<item name="miniKeyboardViewStyle">@style/MiniKeyboardView.Stone</item>
<item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item>
<item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item>
diff --git a/java/res/xml/kbd_mini_keyboard_template.xml b/java/res/xml/kbd_mini_keyboard_template.xml
index d25878b48..ad6cf51fe 100644
--- a/java/res/xml/kbd_mini_keyboard_template.xml
+++ b/java/res/xml/kbd_mini_keyboard_template.xml
@@ -21,5 +21,6 @@
<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:keyWidth="10%p"
latin:rowHeight="@dimen/popup_key_height"
+ style="?attr/miniKeyboardStyle"
>
</Keyboard>
diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
index da91b62d9..ad8056cc0 100644
--- a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
@@ -123,7 +123,9 @@ public class MiniKeyboard extends Keyboard {
}
mWidth = mOccupiedWidth = mNumColumns * mDefaultKeyWidth;
- mHeight = mOccupiedHeight = mNumRows * mDefaultRowHeight + mVerticalGap;
+ // Need to subtract the bottom row's gutter only.
+ mHeight = mOccupiedHeight = mNumRows * mDefaultRowHeight - mVerticalGap
+ + mTopPadding + mBottomPadding;
}
// Return key position according to column count (0 is default).
@@ -209,20 +211,9 @@ public class MiniKeyboard extends Keyboard {
super(view.getContext(), new MiniKeyboardParams());
load(parentKeyboard.mId.cloneWithNewXml(mResources.getResourceEntryName(xmlId), xmlId));
- // HACK: Current mini keyboard design totally relies on the 9-patch
- // padding about horizontal
- // and vertical key spacing. To keep the visual of mini keyboard as
- // is, these hacks are
- // needed to keep having the same horizontal and vertical key
- // spacing.
- mParams.mHorizontalGap = 0;
- mParams.mVerticalGap = mParams.mTopPadding = parentKeyboard.mVerticalGap / 2;
- // TODO: When we have correctly padded key background 9-patch
- // drawables for mini keyboard,
- // revert the above hacks and uncomment the following lines.
- // mParams.mHorizontalGap = parentKeyboard.mHorizontalGap;
- // mParams.mVerticalGap = parentKeyboard.mVerticalGap;
-
+ // TODO: Mini keyboard's vertical gap is currently calculated heuristically.
+ // Should revise the algorithm.
+ mParams.mVerticalGap = parentKeyboard.mVerticalGap / 2;
mParams.mIsRtlKeyboard = parentKeyboard.mIsRtlKeyboard;
mMoreKeys = parentKey.mMoreKeys;