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
This commit is contained in:
parent
59cd73b916
commit
9f01ed51d7
54 changed files with 161 additions and 69 deletions
|
@ -19,8 +19,10 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
|
||||
<dimen name="keyboardHeight">1.060in</dimen>
|
||||
<!-- key_height + key_bottom_gap = popup_key_height -->
|
||||
<dimen name="key_height">0.250in</dimen>
|
||||
<!-- <dimen name="key_height">0.250in</dimen>-->
|
||||
<dimen name="key_bottom_gap">0.020in</dimen>
|
||||
<dimen name="popup_key_height">0.270in</dimen>
|
||||
<dimen name="keyboard_top_padding">0.0in</dimen>
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
|
||||
<dimen name="keyboardHeight">58.0mm</dimen>
|
||||
<!-- key_height + key_bottom_gap = popup_key_height -->
|
||||
<dimen name="key_height">14.5mm</dimen>
|
||||
<!-- <dimen name="key_height">14.5mm</dimen>-->
|
||||
<dimen name="key_bottom_gap">0.0mm</dimen>
|
||||
<dimen name="key_horizontal_gap">0.0mm</dimen>
|
||||
<dimen name="popup_key_height">13.0mm</dimen>
|
||||
|
|
|
@ -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. -->
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -26,9 +26,11 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" />
|
||||
|
|
|
@ -26,10 +26,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.09%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwertz_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwertz_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwertz_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwertz_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_azerty_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_azerty_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -26,9 +26,11 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" />
|
||||
|
|
|
@ -26,10 +26,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.09%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.091%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.091%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -21,10 +21,12 @@
|
|||
<!-- Serbian keyboard layout, based on the X11 layout for Serbian -->
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.09%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -21,10 +21,12 @@
|
|||
<!-- Serbian keyboard layout, based on the X11 layout for Serbian -->
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.09%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -28,9 +28,11 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" />
|
||||
|
|
|
@ -28,10 +28,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="9.09%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" />
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
latin:keyWidth="3.5%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
</Keyboard>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="4.0%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="4.0%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top"
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="11.949%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="11.949%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="11.949%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
latin:keyWidth="5.0%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
</Keyboard>
|
||||
|
|
|
@ -20,9 +20,11 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows" />
|
||||
|
|
|
@ -20,9 +20,11 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,9 +20,11 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="5.5%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="5.0%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top"
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="26.67%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="26.67%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="26.67%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
latin:keyWidth="9.45%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
</Keyboard>
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
</Keyboard>
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_rows" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyboardHeight="@dimen/keyboardHeight"
|
||||
latin:maxKeyboardHeight="50%p"
|
||||
latin:rowHeight="25%p"
|
||||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="@dimen/key_horizontal_gap"
|
||||
latin:verticalGap="@dimen/key_bottom_gap"
|
||||
latin:keyHeight="@dimen/key_height"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="15%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="10%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top|bottom"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
latin:keyWidth="15%p"
|
||||
latin:horizontalGap="0px"
|
||||
latin:verticalGap="0px"
|
||||
latin:keyHeight="@dimen/popup_key_height"
|
||||
latin:rowHeight="@dimen/popup_key_height"
|
||||
>
|
||||
<Row
|
||||
latin:rowEdgeFlags="top"
|
||||
|
|
|
@ -139,7 +139,7 @@ public class Key {
|
|||
/** Create an empty key with no attributes. */
|
||||
public Key(Row row, char letter, int x, int y) {
|
||||
mKeyboard = row.getKeyboard();
|
||||
mHeight = row.mDefaultHeight;
|
||||
mHeight = row.mDefaultHeight - row.mVerticalGap;
|
||||
mGap = row.mDefaultHorizontalGap;
|
||||
mWidth = row.mDefaultWidth - mGap;
|
||||
mEdgeFlags = row.mRowEdgeFlags;
|
||||
|
@ -176,14 +176,14 @@ public class Key {
|
|||
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.Keyboard);
|
||||
mHeight = KeyboardParser.getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_keyHeight,
|
||||
mKeyboard.getKeyboardHeight(), row.mDefaultHeight);
|
||||
R.styleable.Keyboard_rowHeight,
|
||||
mKeyboard.getKeyboardHeight(), row.mDefaultHeight) - row.mVerticalGap;
|
||||
mGap = KeyboardParser.getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_horizontalGap,
|
||||
mKeyboard.getKeyboardWidth(), row.mDefaultHorizontalGap);
|
||||
mKeyboard.getDisplayWidth(), row.mDefaultHorizontalGap);
|
||||
mWidth = KeyboardParser.getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_keyWidth,
|
||||
mKeyboard.getKeyboardWidth(), row.mDefaultWidth) - mGap;
|
||||
mKeyboard.getDisplayWidth(), row.mDefaultWidth) - mGap;
|
||||
a.recycle();
|
||||
|
||||
a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.Keyboard_Key);
|
||||
|
|
|
@ -122,6 +122,9 @@ public class Keyboard {
|
|||
/** Height of the screen */
|
||||
private final int mDisplayHeight;
|
||||
|
||||
/** Height of keyboard */
|
||||
private int mKeyboardHeight;
|
||||
|
||||
public final KeyboardId mId;
|
||||
|
||||
// Variables for pre-computing nearest keys.
|
||||
|
@ -248,11 +251,11 @@ public class Keyboard {
|
|||
mDefaultVerticalGap = gap;
|
||||
}
|
||||
|
||||
public int getKeyHeight() {
|
||||
public int getRowHeight() {
|
||||
return mDefaultHeight;
|
||||
}
|
||||
|
||||
public void setKeyHeight(int height) {
|
||||
public void setRowHeight(int height) {
|
||||
mDefaultHeight = height;
|
||||
}
|
||||
|
||||
|
@ -278,14 +281,22 @@ public class Keyboard {
|
|||
return mTotalWidth;
|
||||
}
|
||||
|
||||
public int getKeyboardHeight() {
|
||||
public int getDisplayHeight() {
|
||||
return mDisplayHeight;
|
||||
}
|
||||
|
||||
public int getKeyboardWidth() {
|
||||
public int getDisplayWidth() {
|
||||
return mDisplayWidth;
|
||||
}
|
||||
|
||||
public int getKeyboardHeight() {
|
||||
return mKeyboardHeight;
|
||||
}
|
||||
|
||||
public void setKeyboardHeight(int height) {
|
||||
mKeyboardHeight = height;
|
||||
}
|
||||
|
||||
public List<Key> getShiftKeys() {
|
||||
return mShiftKeys;
|
||||
}
|
||||
|
|
|
@ -161,12 +161,20 @@ public class KeyboardParser {
|
|||
final Keyboard keyboard = mKeyboard;
|
||||
final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.Keyboard);
|
||||
final int width = keyboard.getKeyboardWidth();
|
||||
final int height = keyboard.getKeyboardHeight();
|
||||
final int displayHeight = keyboard.getDisplayHeight();
|
||||
final int keyboardHeight = (int)a.getDimension(
|
||||
R.styleable.Keyboard_keyboardHeight, displayHeight / 2);
|
||||
final int maxKeyboardHeight = getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_maxKeyboardHeight, displayHeight, displayHeight / 2);
|
||||
// Keyboard height will not exceed maxKeyboardHeight.
|
||||
final int height = Math.min(keyboardHeight, maxKeyboardHeight);
|
||||
final int width = keyboard.getDisplayWidth();
|
||||
|
||||
keyboard.setKeyboardHeight(height);
|
||||
keyboard.setKeyWidth(getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_keyWidth, width, width / 10));
|
||||
keyboard.setKeyHeight(getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_keyHeight, height, 50));
|
||||
keyboard.setRowHeight(getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_rowHeight, height, 50));
|
||||
keyboard.setHorizontalGap(getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_horizontalGap, width, 0));
|
||||
keyboard.setVerticalGap(getDimensionOrFraction(a,
|
||||
|
@ -280,7 +288,7 @@ public class KeyboardParser {
|
|||
final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.Keyboard);
|
||||
final int gap = getDimensionOrFraction(a, R.styleable.Keyboard_horizontalGap,
|
||||
mKeyboard.getKeyboardWidth(), 0);
|
||||
mKeyboard.getDisplayWidth(), 0);
|
||||
a.recycle();
|
||||
checkEndTag(TAG_SPACER, parser);
|
||||
setSpacer(gap);
|
||||
|
@ -494,7 +502,7 @@ public class KeyboardParser {
|
|||
private void endRow() {
|
||||
if (mCurrentRow == null)
|
||||
throw new InflateException("orphant end row tag");
|
||||
mCurrentY += mCurrentRow.mVerticalGap + mCurrentRow.mDefaultHeight;
|
||||
mCurrentY += mCurrentRow.mDefaultHeight;
|
||||
mCurrentRow = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class Row {
|
|||
|
||||
public Row(Keyboard keyboard) {
|
||||
this.mKeyboard = keyboard;
|
||||
mDefaultHeight = keyboard.getKeyHeight();
|
||||
mDefaultHeight = keyboard.getRowHeight();
|
||||
mDefaultWidth = keyboard.getKeyWidth();
|
||||
mDefaultHorizontalGap = keyboard.getHorizontalGap();
|
||||
mVerticalGap = keyboard.getVerticalGap();
|
||||
|
@ -56,14 +56,14 @@ public class Row {
|
|||
|
||||
public Row(Resources res, Keyboard keyboard, XmlResourceParser parser) {
|
||||
this.mKeyboard = keyboard;
|
||||
final int keyboardWidth = keyboard.getKeyboardWidth();
|
||||
final int keyboardWidth = keyboard.getDisplayWidth();
|
||||
final int keyboardHeight = keyboard.getKeyboardHeight();
|
||||
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.Keyboard);
|
||||
mDefaultWidth = KeyboardParser.getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_keyWidth, keyboardWidth, keyboard.getKeyWidth());
|
||||
mDefaultHeight = KeyboardParser.getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_keyHeight, keyboardHeight, keyboard.getKeyHeight());
|
||||
R.styleable.Keyboard_rowHeight, keyboardHeight, keyboard.getRowHeight());
|
||||
mDefaultHorizontalGap = KeyboardParser.getDimensionOrFraction(a,
|
||||
R.styleable.Keyboard_horizontalGap, keyboardWidth, keyboard.getHorizontalGap());
|
||||
mVerticalGap = KeyboardParser.getDimensionOrFraction(a,
|
||||
|
|
Loading…
Reference in a new issue