Specify Key gaps by percentage

Change-Id: I4721bf831b5edbea1dd4309c6ce907544b098d62
main
Tadashi G. Takaoka 2011-07-04 15:09:21 +09:00
parent c190da0e02
commit 9812fb0fe9
10 changed files with 94 additions and 90 deletions

View File

@ -27,21 +27,22 @@
<dimen name="popup_key_height">0.280in</dimen> <dimen name="popup_key_height">0.280in</dimen>
<dimen name="keyboard_horizontal_edges_padding">0.0in</dimen> <dimen name="keyboard_horizontal_edges_padding">0.0in</dimen>
<dimen name="keyboard_top_padding">0.02in</dimen> <fraction name="keyboard_top_padding">1.818%p</fraction>
<dimen name="keyboard_bottom_padding">0.00in</dimen> <fraction name="keyboard_bottom_padding">0.0%p</fraction>
<dimen name="key_bottom_gap">1.21mm</dimen> <fraction name="key_bottom_gap">4.330%p</fraction>
<dimen name="key_horizontal_gap">0.35mm</dimen> <fraction name="key_horizontal_gap">0.405%p</fraction>
<dimen name="key_bottom_gap_stone">1.40mm</dimen> <dimen name="keyboardHeight_stone">0.984in</dimen>
<dimen name="key_horizontal_gap_stone">1.00mm</dimen> <fraction name="key_bottom_gap_stone">5.010%p</fraction>
<fraction name="key_horizontal_gap_stone">1.159%p</fraction>
<dimen name="key_bottom_gap_gb">1.66mm</dimen> <fraction name="key_bottom_gap_gb">5.941%p</fraction>
<dimen name="key_horizontal_gap_gb">0.86mm</dimen> <fraction name="key_horizontal_gap_gb">0.997%p</fraction>
<dimen name="keyboard_top_padding_ics">0.03in</dimen> <fraction name="keyboard_top_padding_ics">2.727%p</fraction>
<dimen name="keyboard_bottom_padding_ics">0.00in</dimen> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction>
<dimen name="key_bottom_gap_ics">1.50mm</dimen> <fraction name="key_bottom_gap_ics">5.368%p</fraction>
<dimen name="key_horizontal_gap_ics">0.88mm</dimen> <fraction name="key_horizontal_gap_ics">1.020%p</fraction>
<!-- left or right padding of label alignment --> <!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_padding">8dip</dimen> <dimen name="key_label_horizontal_padding">8dip</dimen>

View File

@ -24,21 +24,19 @@
<fraction name="minKeyboardHeight">45%p</fraction> <fraction name="minKeyboardHeight">45%p</fraction>
<dimen name="keyboard_horizontal_edges_padding">0dp</dimen> <dimen name="keyboard_horizontal_edges_padding">0dp</dimen>
<dimen name="keyboard_top_padding">1.1mm</dimen> <fraction name="keyboard_top_padding">2.444%p</fraction>
<dimen name="keyboard_bottom_padding">0.0mm</dimen> <fraction name="keyboard_bottom_padding">0.0%p</fraction>
<dimen name="key_bottom_gap">2.21mm</dimen> <fraction name="key_bottom_gap">4.911%p</fraction>
<dimen name="key_horizontal_gap">1.97mm</dimen> <fraction name="key_horizontal_gap">1.284%p</fraction>
<dimen name="key_bottom_gap_stone">1.96mm</dimen> <dimen name="keyboardHeight_stone">45.0mm</dimen>
<dimen name="key_horizontal_gap_stone">2.31mm</dimen> <fraction name="key_bottom_gap_stone">4.355%p</fraction>
<fraction name="key_horizontal_gap_stone">1.505%p</fraction>
<dimen name="key_bottom_gap_gb">2.34mm</dimen> <fraction name="key_bottom_gap_gb">5.200%p</fraction>
<dimen name="key_horizontal_gap_gb">2.22mm</dimen> <fraction name="key_horizontal_gap_gb">1.447%p</fraction>
<dimen name="key_bottom_gap_ics">1.66mm</dimen> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction>
<dimen name="key_horizontal_gap_ics">1.66mm</dimen>
<dimen name="keyboard_top_padding_ics">1.1mm</dimen>
<dimen name="keyboard_bottom_padding_ics">0.0mm</dimen>
<dimen name="popup_key_height">13.0mm</dimen> <dimen name="popup_key_height">13.0mm</dimen>

View File

@ -27,21 +27,19 @@
<dimen name="popup_key_height">10.0mm</dimen> <dimen name="popup_key_height">10.0mm</dimen>
<dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen> <dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</dimen> <fraction name="keyboard_top_padding">2.291%p</fraction>
<dimen name="keyboard_bottom_padding">0.0mm</dimen> <fraction name="keyboard_bottom_padding">0.0%p</fraction>
<dimen name="key_bottom_gap">1.80mm</dimen> <fraction name="key_bottom_gap">3.750%p</fraction>
<dimen name="key_horizontal_gap">1.67mm</dimen> <fraction name="key_horizontal_gap">1.857%p</fraction>
<dimen name="key_bottom_gap_stone">1.80mm</dimen> <dimen name="keyboardHeight_stone">48.0mm</dimen>
<dimen name="key_horizontal_gap_stone">1.44mm</dimen> <fraction name="key_bottom_gap_stone">3.75%p</fraction>
<fraction name="key_horizontal_gap_stone">1.602%p</fraction>
<dimen name="key_bottom_gap_gb">2.22mm</dimen> <fraction name="key_bottom_gap_gb">4.625%p</fraction>
<dimen name="key_horizontal_gap_gb">1.90mm</dimen> <fraction name="key_horizontal_gap_gb">2.113%p</fraction>
<dimen name="key_bottom_gap_ics">1.37mm</dimen> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction>
<dimen name="key_horizontal_gap_ics">1.53mm</dimen>
<dimen name="keyboard_top_padding_ics">1.1mm</dimen>
<dimen name="keyboard_bottom_padding_ics">0.0mm</dimen>
<dimen name="mini_keyboard_key_horizontal_padding">6dip</dimen> <dimen name="mini_keyboard_key_horizontal_padding">6dip</dimen>
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->

View File

@ -24,22 +24,23 @@
<fraction name="minKeyboardHeight">45%p</fraction> <fraction name="minKeyboardHeight">45%p</fraction>
<dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen> <dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</dimen> <fraction name="keyboard_top_padding">1.896%p</fraction>
<dimen name="keyboard_bottom_padding">0.0mm</dimen> <fraction name="keyboard_bottom_padding">0.0%p</fraction>
<dimen name="key_bottom_gap">2.65mm</dimen> <fraction name="key_bottom_gap">4.103%p</fraction>
<dimen name="key_horizontal_gap">2.34mm</dimen> <fraction name="key_horizontal_gap">1.034%p</fraction>
<dimen name="key_bottom_gap_stone">1.96mm</dimen> <dimen name="keyboardHeight_stone">58.0mm</dimen>
<dimen name="key_horizontal_gap_stone">2.31mm</dimen> <fraction name="key_bottom_gap_stone">3.379%p</fraction>
<fraction name="key_horizontal_gap_stone">1.062%p</fraction>
<dimen name="key_bottom_gap_gb">2.80mm</dimen> <fraction name="key_bottom_gap_gb">3.896%p</fraction>
<dimen name="key_horizontal_gap_gb">2.60mm</dimen> <fraction name="key_horizontal_gap_gb">1.195%p</fraction>
<dimen name="key_bottom_gap_ics">2.25mm</dimen> <fraction name="keyboard_top_padding_ics">1.896%p</fraction>
<dimen name="key_horizontal_gap_ics">2.22mm</dimen> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction>
<dimen name="keyboard_top_padding_ics">1.1mm</dimen> <fraction name="key_bottom_gap_ics">3.690%p</fraction>
<dimen name="keyboard_bottom_padding_ics">0.0mm</dimen> <fraction name="key_horizontal_gap_ics">1.030%p</fraction>
<dimen name="popup_key_height">13.0mm</dimen> <dimen name="popup_key_height">13.0mm</dimen>

View File

@ -25,22 +25,22 @@
<fraction name="minKeyboardHeight">-35.0%p</fraction> <fraction name="minKeyboardHeight">-35.0%p</fraction>
<dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen> <dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</dimen> <fraction name="keyboard_top_padding">2.291%p</fraction>
<dimen name="keyboard_bottom_padding">0.0mm</dimen> <fraction name="keyboard_bottom_padding">0.0%p</fraction>
<dimen name="key_bottom_gap">2.05mm</dimen> <fraction name="key_bottom_gap">4.270%p</fraction>
<dimen name="key_horizontal_gap">2.11mm</dimen> <fraction name="key_horizontal_gap">1.551%p</fraction>
<dimen name="key_bottom_gap_stone">1.80mm</dimen> <dimen name="keyboardHeight_stone">48.0mm</dimen>
<dimen name="key_horizontal_gap_stone">1.44mm</dimen> <fraction name="key_bottom_gap_stone">3.75%p</fraction>
<fraction name="key_horizontal_gap_stone">1.059%p</fraction>
<dimen name="key_bottom_gap_gb">2.25mm</dimen> <fraction name="key_bottom_gap_gb">4.687%p</fraction>
<dimen name="key_horizontal_gap_gb">1.96mm</dimen> <fraction name="key_horizontal_gap_gb">1.272%p</fraction>
<dimen name="key_bottom_gap_ics">1.75mm</dimen> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction>
<dimen name="key_horizontal_gap_ics">1.79mm</dimen> <fraction name="key_bottom_gap_ics">3.312%p</fraction>
<dimen name="keyboard_top_padding_ics">1.1mm</dimen> <fraction name="key_horizontal_gap_ics">1.066%p</fraction>
<dimen name="keyboard_bottom_padding_ics">0.0mm</dimen>
<dimen name="popup_key_height">10.0mm</dimen> <dimen name="popup_key_height">10.0mm</dimen>

View File

@ -30,22 +30,25 @@
<dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen> <dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen>
<dimen name="keyboard_horizontal_edges_padding">0dp</dimen> <dimen name="keyboard_horizontal_edges_padding">0dp</dimen>
<dimen name="keyboard_top_padding">0.02in</dimen> <fraction name="keyboard_top_padding">1.556%p</fraction>
<dimen name="keyboard_bottom_padding">0.06in</dimen> <fraction name="keyboard_bottom_padding">4.669%p</fraction>
<dimen name="key_bottom_gap">2.04mm</dimen> <fraction name="key_bottom_gap">6.250%p</fraction>
<dimen name="key_horizontal_gap">0.70mm</dimen> <fraction name="key_horizontal_gap">1.352%p</fraction>
<dimen name="key_bottom_gap_stone">2.45mm</dimen> <dimen name="keyboardHeight_stone">1.317in</dimen>
<dimen name="key_horizontal_gap_stone">0.90mm</dimen> <fraction name="keyboard_top_padding_stone">1.556%p</fraction>
<fraction name="keyboard_bottom_padding_stone">0.778%p</fraction>
<fraction name="key_bottom_gap_stone">7.506%p</fraction>
<fraction name="key_horizontal_gap_stone">1.739%p</fraction>
<dimen name="key_bottom_gap_gb">2.12mm</dimen> <fraction name="key_bottom_gap_gb">6.495%p</fraction>
<dimen name="key_horizontal_gap_gb">1.02mm</dimen> <fraction name="key_horizontal_gap_gb">1.971%p</fraction>
<dimen name="keyboard_top_padding_ics">0.03in</dimen> <fraction name="keyboard_top_padding_ics">2.335%p</fraction>
<dimen name="keyboard_bottom_padding_ics">0.06in</dimen> <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">6dp</dimen>
<dimen name="key_bottom_gap_ics">2.00mm</dimen>
<dimen name="key_horizontal_gap_ics">0.90mm</dimen>
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
<!-- popup_key_height x 1.2 --> <!-- popup_key_height x 1.2 -->

View File

@ -22,10 +22,10 @@
<item name="maxKeyboardHeight">@fraction/maxKeyboardHeight</item> <item name="maxKeyboardHeight">@fraction/maxKeyboardHeight</item>
<item name="minKeyboardHeight">@fraction/minKeyboardHeight</item> <item name="minKeyboardHeight">@fraction/minKeyboardHeight</item>
<item name="popupKeyboardTemplate">@xml/kbd_popup_template</item> <item name="popupKeyboardTemplate">@xml/kbd_popup_template</item>
<item name="keyboardTopPadding">@dimen/keyboard_top_padding</item> <item name="keyboardTopPadding">@fraction/keyboard_top_padding</item>
<item name="keyboardBottomPadding">@dimen/keyboard_bottom_padding</item> <item name="keyboardBottomPadding">@fraction/keyboard_bottom_padding</item>
<item name="horizontalGap">@dimen/key_horizontal_gap</item> <item name="horizontalGap">@fraction/key_horizontal_gap</item>
<item name="verticalGap">@dimen/key_bottom_gap</item> <item name="verticalGap">@fraction/key_bottom_gap</item>
<item name="maxPopupKeyboardColumn">@integer/config_max_popup_keyboard_column</item> <item name="maxPopupKeyboardColumn">@integer/config_max_popup_keyboard_column</item>
</style> </style>
<style name="LatinKeyboard"> <style name="LatinKeyboard">
@ -101,8 +101,11 @@
</style> </style>
<!-- Theme "Stone" --> <!-- Theme "Stone" -->
<style name="Keyboard.Stone" parent="Keyboard"> <style name="Keyboard.Stone" parent="Keyboard">
<item name="horizontalGap">@dimen/key_horizontal_gap_stone</item> <item name="keyboardHeight">@dimen/keyboardHeight_stone</item>
<item name="verticalGap">@dimen/key_bottom_gap_stone</item> <item name="keyboardTopPadding">@fraction/keyboard_top_padding_stone</item>
<item name="keyboardBottomPadding">@fraction/keyboard_bottom_padding_stone</item>
<item name="horizontalGap">@fraction/key_horizontal_gap_stone</item>
<item name="verticalGap">@fraction/key_bottom_gap_stone</item>
</style> </style>
<style name="LatinKeyboard.Stone" parent="LatinKeyboard"> <style name="LatinKeyboard.Stone" parent="LatinKeyboard">
<item name="spacebarTextColor">#FF000000</item> <item name="spacebarTextColor">#FF000000</item>
@ -129,8 +132,8 @@
</style> </style>
<!-- Theme "Gingerbread" --> <!-- Theme "Gingerbread" -->
<style name="Keyboard.Gingerbread" parent="Keyboard"> <style name="Keyboard.Gingerbread" parent="Keyboard">
<item name="horizontalGap">@dimen/key_horizontal_gap_gb</item> <item name="horizontalGap">@fraction/key_horizontal_gap_gb</item>
<item name="verticalGap">@dimen/key_bottom_gap_gb</item> <item name="verticalGap">@fraction/key_bottom_gap_gb</item>
</style> </style>
<style name="KeyboardView.Gingerbread" parent="KeyboardView"> <style name="KeyboardView.Gingerbread" parent="KeyboardView">
<item name="android:background">@drawable/keyboard_dark_background</item> <item name="android:background">@drawable/keyboard_dark_background</item>
@ -142,10 +145,10 @@
</style> </style>
<!-- Theme "IceCreamSandwich" --> <!-- Theme "IceCreamSandwich" -->
<style name="Keyboard.IceCreamSandwich" parent="Keyboard" > <style name="Keyboard.IceCreamSandwich" parent="Keyboard" >
<item name="keyboardTopPadding">@dimen/keyboard_top_padding_ics</item> <item name="keyboardTopPadding">@fraction/keyboard_top_padding_ics</item>
<item name="keyboardBottomPadding">@dimen/keyboard_bottom_padding_ics</item> <item name="keyboardBottomPadding">@fraction/keyboard_bottom_padding_ics</item>
<item name="horizontalGap">@dimen/key_horizontal_gap_ics</item> <item name="horizontalGap">@fraction/key_horizontal_gap_ics</item>
<item name="verticalGap">@dimen/key_bottom_gap_ics</item> <item name="verticalGap">@fraction/key_bottom_gap_ics</item>
</style> </style>
<style name="LatinKeyboard.IceCreamSandwich" parent="LatinKeyboard"> <style name="LatinKeyboard.IceCreamSandwich" parent="LatinKeyboard">
<item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item>

View File

@ -20,7 +20,7 @@
<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:keyWidth="8%p" latin:keyWidth="8%p"
latin:horizontalGap="@dimen/key_horizontal_gap" latin:horizontalGap="@fraction/key_horizontal_gap"
latin:verticalGap="0px" latin:verticalGap="0px"
latin:rowHeight="@dimen/popup_key_height" latin:rowHeight="@dimen/popup_key_height"
> >

View File

@ -20,7 +20,7 @@
<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:keyWidth="10%p" latin:keyWidth="10%p"
latin:horizontalGap="@dimen/key_horizontal_gap" latin:horizontalGap="@fraction/key_horizontal_gap"
latin:verticalGap="0px" latin:verticalGap="0px"
latin:rowHeight="@dimen/popup_key_height" latin:rowHeight="@dimen/popup_key_height"
> >

View File

@ -236,10 +236,10 @@ public class KeyboardParser {
R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5)); R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5));
mKeyboard.mIconsSet.loadIcons(keyboardAttr); mKeyboard.mIconsSet.loadIcons(keyboardAttr);
mKeyboardTopPadding = keyboardAttr.getDimensionPixelSize( mKeyboardTopPadding = getDimensionOrFraction(keyboardAttr,
R.styleable.Keyboard_keyboardTopPadding, 0); R.styleable.Keyboard_keyboardTopPadding, height, 0);
mKeyboardBottomPadding = keyboardAttr.getDimensionPixelSize( mKeyboardBottomPadding = getDimensionOrFraction(keyboardAttr,
R.styleable.Keyboard_keyboardBottomPadding, 0); R.styleable.Keyboard_keyboardBottomPadding, height, 0);
} finally { } finally {
keyAttr.recycle(); keyAttr.recycle();
keyboardAttr.recycle(); keyboardAttr.recycle();