Adaptive keyboard width/position parser (DO NOT MERGE)

This change introduces the following features to Keyboard XML format.

 * "keyXPos" can specify the key X coordinate directly.
 * "keyXPos" can be negative. The X coordinate will be calcluated from
    the right edge of the keyboard toward left.
 * "keyWidth" can be zero to be filled up to the right side.
 * "keyWidth can be negative. The key will be filled up to both sides.
 * Spacer's horizontalGap is renamed as keyWidth, and can be inherited
   from key-style.
 * Spacer can have keyXPos attribute.

Using these syntax, all keyboard layouts have been re-written.

Bug: 4442045
Change-Id: I314b2e8ca2aa145ff9506cbf927140a15685af42
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 3bd6619..c63ecbe 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -83,7 +83,12 @@
         <!-- Default width of a key, in pixels or percentage of display width. -->
         <attr name="keyWidth" format="dimension|fraction" />
         <!-- Default height of a row (key height + vertical gap), in pixels or percentage of
-             keyboard height. -->
+             keyboard height.
+             If the value is zero, the actual key width will be determined to fill out the area up
+             to the right edge of the keyboard.
+             If the value is negative, 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.
+             -->
         <attr name="rowHeight" format="dimension|fraction" />
         <!-- Default horizontal gap between keys. -->
         <attr name="horizontalGap" format="dimension|fraction" />
@@ -142,6 +147,9 @@
         <attr name="shiftedIcon" format="reference" />
         <!-- The key is enabled and responds on press. -->
         <attr name="enabled" format="boolean" />
+        <!-- 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. -->
+        <attr name="keyXPos" format="dimension|fraction" />
     </declare-styleable>
 
     <declare-styleable name="Keyboard_Row">