am 1c2cf719: Add new value "spacebar" to Key.backgroundType attribute
* commit '1c2cf71921f0f09e39c1df86c1e57d4c607aad34': Add new value "spacebar" to Key.backgroundType attributemain
commit
c297197b15
|
@ -284,6 +284,7 @@
|
|||
<enum name="stickyOff" value="3" />
|
||||
<enum name="stickyOn" value="4" />
|
||||
<enum name="action" value="5" />
|
||||
<enum name="spacebar" value="6" />
|
||||
</attr>
|
||||
<!-- The key action flags. -->
|
||||
<attr name="keyActionFlags" format="integer">
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
<key-style
|
||||
latin:styleName="spaceKeyStyle"
|
||||
latin:keySpec="!icon/space_key|!code/key_space"
|
||||
latin:backgroundType="spacebar"
|
||||
latin:keyActionFlags="noKeyPreview|enableLongPress" />
|
||||
<!-- U+200C: ZERO WIDTH NON-JOINER
|
||||
U+200D: ZERO WIDTH JOINER -->
|
||||
|
|
|
@ -141,9 +141,8 @@
|
|||
</Row>
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyStyle="spaceKeyStyle"
|
||||
latin:keyWidth="30%p"
|
||||
latin:backgroundType="functional" />
|
||||
latin:keyStyle="tabletNumSpaceKeyStyle"
|
||||
latin:keyWidth="30%p" />
|
||||
<Key
|
||||
latin:keyStyle="numStarKeyStyle"
|
||||
latin:keyXPos="31%p" />
|
||||
|
|
|
@ -107,9 +107,8 @@
|
|||
</Row>
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyStyle="spaceKeyStyle"
|
||||
latin:keyWidth="30%p"
|
||||
latin:backgroundType="functional" />
|
||||
latin:keyStyle="tabletNumSpaceKeyStyle"
|
||||
latin:keyWidth="30%p" />
|
||||
<Key
|
||||
latin:keyStyle="numStarKeyStyle"
|
||||
latin:keyXPos="31%p" />
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<Key
|
||||
latin:backgroundType="normal"
|
||||
latin:keyStyle="spaceKeyStyle"
|
||||
latin:keyWidth="30%p" />
|
||||
</merge>
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
<key-style
|
||||
latin:styleName="spaceKeyStyle"
|
||||
latin:keySpec="!icon/space_key|!code/key_space"
|
||||
latin:backgroundType="spacebar"
|
||||
latin:keyActionFlags="noKeyPreview|enableLongPress" />
|
||||
<!-- U+200C: ZERO WIDTH NON-JOINER
|
||||
U+200D: ZERO WIDTH JOINER -->
|
||||
|
|
|
@ -123,4 +123,24 @@
|
|||
latin:keyLabelFlags="alignIconToBottom"
|
||||
latin:keyActionFlags="enableLongPress"
|
||||
latin:parentStyle="numKeyBaseStyle" />
|
||||
<!-- TODO: Consolidate these space key styles with numSpaceKeyStyle above by introducing <case>
|
||||
predicator that checks device form-factor. -->
|
||||
<switch>
|
||||
<case latin:keyboardTheme="ICS|KLP">
|
||||
<key-style
|
||||
latin:styleName="tabletNumSpaceKeyStyle"
|
||||
latin:keySpec="!icon/space_key|!code/key_space"
|
||||
latin:backgroundType="functional"
|
||||
latin:keyActionFlags="enableLongPress"
|
||||
latin:parentStyle="numKeyBaseStyle" />
|
||||
</case>
|
||||
<case latin:keyboardTheme="LXXLight|LXXDark">
|
||||
<key-style
|
||||
latin:styleName="tabletNumSpaceKeyStyle"
|
||||
latin:keySpec="!icon/space_key|!code/key_space"
|
||||
latin:backgroundType="spacebar"
|
||||
latin:keyActionFlags="enableLongPress"
|
||||
latin:parentStyle="numKeyBaseStyle" />
|
||||
</case>
|
||||
</switch>
|
||||
</merge>
|
||||
|
|
|
@ -139,6 +139,7 @@ public class Key implements Comparable<Key> {
|
|||
public static final int BACKGROUND_TYPE_STICKY_OFF = 3;
|
||||
public static final int BACKGROUND_TYPE_STICKY_ON = 4;
|
||||
public static final int BACKGROUND_TYPE_ACTION = 5;
|
||||
public static final int BACKGROUND_TYPE_SPACEBAR = 6;
|
||||
|
||||
private final int mActionFlags;
|
||||
private static final int ACTION_FLAGS_IS_REPEATABLE = 0x01;
|
||||
|
@ -505,6 +506,7 @@ public class Key implements Comparable<Key> {
|
|||
case BACKGROUND_TYPE_STICKY_OFF: return "stickyOff";
|
||||
case BACKGROUND_TYPE_STICKY_ON: return "stickyOn";
|
||||
case BACKGROUND_TYPE_ACTION: return "action";
|
||||
case BACKGROUND_TYPE_SPACEBAR: return "spacebar";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
@ -871,6 +873,8 @@ public class Key implements Comparable<Key> {
|
|||
new KeyBackgroundState(android.R.attr.state_checkable, android.R.attr.state_checked),
|
||||
// 5: BACKGROUND_TYPE_ACTION
|
||||
new KeyBackgroundState(android.R.attr.state_active),
|
||||
// 6: BACKGROUND_TYPE_SPACEBAR
|
||||
new KeyBackgroundState(),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -884,7 +888,7 @@ public class Key implements Comparable<Key> {
|
|||
final Drawable background;
|
||||
if (mBackgroundType == BACKGROUND_TYPE_FUNCTIONAL) {
|
||||
background = functionalKeyBackground;
|
||||
} else if (getCode() == Constants.CODE_SPACE) {
|
||||
} else if (mBackgroundType == BACKGROUND_TYPE_SPACEBAR) {
|
||||
background = spacebarBackground;
|
||||
} else {
|
||||
background = keyBackground;
|
||||
|
|
Loading…
Reference in New Issue