Add Key label off center attribute

This CL adds two Key attributes to control how much a label should be
off centered.
- keyLabelOffCenterRatio
- keyHintLabelOffCenterRatio

Bug: 14419121
Change-Id: I26650eefdd375f0eeca8a1ca6034a8339d2a3182
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 37ba396..91cd017 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -293,7 +293,7 @@
         <attr name="keyLabelFlags" format="integer">
             <!-- This should be aligned with Key.LABEL_FLAGS__* -->
             <flag name="alignIconToBottom" value="0x04" />
-            <flag name="alignLeftOfCenter" value="0x08" />
+            <flag name="alignLabelOffCenter" value="0x08" />
             <flag name="fontNormal" value="0x10" />
             <flag name="fontMonoSpace" value="0x20" />
             <flag name="fontDefault" value="0x30" />
@@ -368,6 +368,14 @@
         <attr name="keyHintLabelRatio" format="fraction" />
         <!-- Size of the text for shifted letter hint, in the proportion of key height. -->
         <attr name="keyShiftedLetterHintRatio" format="fraction" />
+        <!-- The label's horizontal offset to the center of the key. Negative is to left and
+             positive is to right. The value is in proportion of the width of
+             TypefaceUtils.KEY_LABEL_REFERENCE_CHAR. -->
+        <attr name="keyLabelOffCenterRatio" format="fraction" />
+        <!-- The hint label's horizontal offset to the center of the key. Negative is to left and
+             positive is to right. The value is in proportion of the width of
+             TypefaceUtils.KEY_LABEL_REFERENCE_CHAR. -->
+        <attr name="keyHintLabelOffCenterRatio" format="fraction" />
         <!-- Color to use for the label in a key. -->
         <attr name="keyTextColor" format="color" />
         <attr name="keyTextShadowColor" format="color" />
diff --git a/java/res/values/themes-common.xml b/java/res/values/themes-common.xml
index b139110..02e671b 100644
--- a/java/res/values/themes-common.xml
+++ b/java/res/values/themes-common.xml
@@ -38,6 +38,8 @@
         <item name="keyHintLetterRatio">@fraction/config_key_hint_letter_ratio</item>
         <item name="keyHintLabelRatio">@fraction/config_key_hint_label_ratio</item>
         <item name="keyShiftedLetterHintRatio">@fraction/config_key_shifted_letter_hint_ratio</item>
+        <item name="keyLabelOffCenterRatio">-175%</item>
+        <item name="keyHintLabelOffCenterRatio">200%</item>
         <item name="keyTypeface">normal</item>
         <item name="keyHintLetterPadding">@dimen/config_key_hint_letter_padding</item>
         <item name="keyPopupHintLetterPadding">@dimen/config_key_popup_hint_letter_padding</item>