Remove "fillBoth" enum value from keyWidth attribute of Key

Change-Id: Icc5ffb8286aeda298b46aeba05e44608e342bc57
This commit is contained in:
Tadashi G. Takaoka 2012-05-14 19:17:09 +09:00
parent ea468ee687
commit 30236efee1
5 changed files with 4 additions and 18 deletions

View file

@ -308,14 +308,10 @@
<attr name="visualInsetsRight" format="dimension|fraction" /> <attr name="visualInsetsRight" format="dimension|fraction" />
<!-- Width of the key, in pixels or percentage of display width. <!-- Width of the key, in pixels or percentage of display width.
If the value is fillRight, the actual key width will be determined to fill out the area If the value is fillRight, the actual key width will be determined to fill out the area
up to the right edge of the keyboard. up to the right edge of the keyboard. -->
If the value is fillBoth, the actual key width will be determined to fill out the
area between the nearest key on the left hand side and the right edge of the keyboard.
-->
<!-- This should be aligned with KeyboardBuilder.Row.KEYWIDTH_* --> <!-- This should be aligned with KeyboardBuilder.Row.KEYWIDTH_* -->
<attr name="keyWidth" format="dimension|fraction|enum"> <attr name="keyWidth" format="dimension|fraction|enum">
<enum name="fillRight" value="-1" /> <enum name="fillRight" value="-1" />
<enum name="fillBoth" value="-2" />
</attr> </attr>
<!-- The X-coordinate of upper right corner of this key including horizontal gap. <!-- The X-coordinate of upper right corner of this key including horizontal gap.
If the value is negative, the origin is the right edge of the keyboard. --> If the value is negative, the origin is the right edge of the keyboard. -->

View file

@ -47,7 +47,7 @@
latin:keyboardLayout="@xml/rowkeys_georgian3" /> latin:keyboardLayout="@xml/rowkeys_georgian3" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillBoth" latin:keyWidth="fillRight"
latin:visualInsetsLeft="1%p" /> latin:visualInsetsLeft="1%p" />
</Row> </Row>
<include <include

View file

@ -47,7 +47,7 @@
latin:keyboardLayout="@xml/rowkeys_qwerty3" /> latin:keyboardLayout="@xml/rowkeys_qwerty3" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillBoth" latin:keyWidth="fillRight"
latin:visualInsetsLeft="1%p" /> latin:visualInsetsLeft="1%p" />
</Row> </Row>
<include <include

View file

@ -46,7 +46,7 @@
latin:keyboardLayout="@xml/rowkeys_qwerty3" /> latin:keyboardLayout="@xml/rowkeys_qwerty3" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillBoth" latin:keyWidth="fillRight"
latin:visualInsetsLeft="1%p" /> latin:visualInsetsLeft="1%p" />
</Row> </Row>
<include <include

View file

@ -511,7 +511,6 @@ public class Keyboard {
// keyWidth enum constants // keyWidth enum constants
private static final int KEYWIDTH_NOT_ENUM = 0; private static final int KEYWIDTH_NOT_ENUM = 0;
private static final int KEYWIDTH_FILL_RIGHT = -1; private static final int KEYWIDTH_FILL_RIGHT = -1;
private static final int KEYWIDTH_FILL_BOTH = -2;
private final Params mParams; private final Params mParams;
/** Default width of a key in this row. */ /** Default width of a key in this row. */
@ -576,11 +575,6 @@ public class Keyboard {
public float getKeyX(TypedArray keyAttr) { public float getKeyX(TypedArray keyAttr) {
final int widthType = Builder.getEnumValue(keyAttr, final int widthType = Builder.getEnumValue(keyAttr,
R.styleable.Keyboard_Key_keyWidth, KEYWIDTH_NOT_ENUM); R.styleable.Keyboard_Key_keyWidth, KEYWIDTH_NOT_ENUM);
if (widthType == KEYWIDTH_FILL_BOTH) {
// If keyWidth is fillBoth, the key width should start right after the nearest
// key on the left hand side.
return mCurrentX;
}
final int keyboardRightEdge = mParams.mOccupiedWidth final int keyboardRightEdge = mParams.mOccupiedWidth
- mParams.mHorizontalEdgesPadding; - mParams.mHorizontalEdgesPadding;
@ -610,14 +604,10 @@ public class Keyboard {
R.styleable.Keyboard_Key_keyWidth, KEYWIDTH_NOT_ENUM); R.styleable.Keyboard_Key_keyWidth, KEYWIDTH_NOT_ENUM);
switch (widthType) { switch (widthType) {
case KEYWIDTH_FILL_RIGHT: case KEYWIDTH_FILL_RIGHT:
case KEYWIDTH_FILL_BOTH:
final int keyboardRightEdge = final int keyboardRightEdge =
mParams.mOccupiedWidth - mParams.mHorizontalEdgesPadding; mParams.mOccupiedWidth - mParams.mHorizontalEdgesPadding;
// If keyWidth is fillRight, the actual key width will be determined to fill // If keyWidth is fillRight, the actual key width will be determined to fill
// out the area up to the right edge of the keyboard. // out the area up to the right edge of the keyboard.
// If keyWidth is fillBoth, the actual key width will be determined to fill out
// the area between the nearest key on the left hand side and the right edge of
// the keyboard.
return keyboardRightEdge - keyXPos; return keyboardRightEdge - keyXPos;
default: // KEYWIDTH_NOT_ENUM default: // KEYWIDTH_NOT_ENUM
return Builder.getDimensionOrFraction(keyAttr, return Builder.getDimensionOrFraction(keyAttr,