Support keyboardHeight and maxKeyboardHeight to Keyboard XML
This change introduces,
- new attribute keyboardHeight to specify default keyboard height.
- new attribute maxKeyboardHeight to specify maximum keyboard height,
usually specified by percentage to the screen height.
- keyHeight attribute is obsoleted
- new attribute rowHeight to specify a row height, can be specifed as
percentage of the keyboard height. And verticalGap is included to
the row height (row height = key height + vertical gap).
Change-Id: I48a2f2661e8a91a998503a847437c1baf1de9b9c
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 4fc5351..55c806c 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -76,10 +76,15 @@
</declare-styleable>
<declare-styleable name="Keyboard">
+ <!-- Default keyboard height -->
+ <attr name="keyboardHeight" format="dimension" />
+ <!-- Maximum keyboard height, in pixels or percentage of display height -->
+ <attr name="maxKeyboardHeight" format="dimension|fraction" />
<!-- Default width of a key, in pixels or percentage of display width. -->
<attr name="keyWidth" format="dimension|fraction" />
- <!-- Default height of a key, in pixels or percentage of display width. -->
- <attr name="keyHeight" format="dimension|fraction" />
+ <!-- Default height of a row (key height + vertical gap), in pixels or percentage of
+ keyboard height. -->
+ <attr name="rowHeight" format="dimension|fraction" />
<!-- Default horizontal gap between keys. -->
<attr name="horizontalGap" format="dimension|fraction" />
<!-- Default vertical gap between rows of keys. -->
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 833963c..27d324b 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -19,8 +19,10 @@
-->
<resources>
+ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
+ <dimen name="keyboardHeight">1.265in</dimen>
<!-- key_height + key_bottom_gap = popup_key_height -->
- <dimen name="key_height">0.290in</dimen>
+<!-- <dimen name="key_height">0.290in</dimen>-->
<dimen name="key_bottom_gap">0.035in</dimen>
<dimen name="key_horizontal_gap">0.000in</dimen>
<dimen name="popup_key_height">0.325in</dimen>