Add Key.keyHintLabel and remove Key.keyHintIcon

This change also removes manualTemporaryUpperCaseCode and
manualTemporaryUpperCaseHintIcon.  Instead of these keyLabelOption now
has hasUppercaseLetter flag value.

Bug: 4436327
Change-Id: I88fdac1e888a7123735296f5ef45f5fdd565cd2e
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 3bed880..2db529e 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -39,19 +39,27 @@
              checkable+checked+pressed. -->
         <attr name="keyBackground" format="reference" />
 
-        <!-- Size of the text for one letter character keys, in the proportion of key height.
-             -->
+        <!-- Size of the text for one letter keys, in the proportion of key height. -->
         <attr name="keyLetterRatio" format="float" />
-
-        <!-- Size of the text for custom keys with some text and no icon, in the proportion of key
-             height. -->
-        <attr name="labelTextRatio" format="float" />
+        <!-- Size of the text for keys with some text, in the proportion of key height. -->
+        <attr name="keyLabelRatio" format="float" />
+        <!-- Size of the text for hint letter, in the proportion of key height. -->
+        <attr name="keyHintLetterRatio" format="float" />
+        <!-- Size of the text for upper case letter, in the proportion of key height. -->
+        <attr name="keyUppercaseLetterRatio" format="float" />
 
         <!-- Color to use for the label in a key. -->
         <attr name="keyTextColor" format="color" />
+        <!-- Color to use for the label in a key when in inactivated state. -->
+        <attr name="keyTextInactivatedColor" format="color" />
+        <!-- Key hint letter color -->
+        <attr name="keyHintLetterColor" format="color" />
+        <!-- Upper case letter colors -->
+        <attr name="keyUppercaseLetterInactivatedColor" format="color" />
+        <attr name="keyUppercaseLetterActivatedColor" format="color" />
 
-        <!-- Color to use for the label in a key when in disabled state. -->
-        <attr name="keyTextColorDisabled" format="color" />
+        <!-- Popup hint icon "..." -->
+        <attr name="keyPopupHintIcon" format="reference" />
 
         <!-- Layout resource for key press feedback.-->
         <attr name="keyPreviewLayout" format="reference" />
@@ -75,7 +83,7 @@
         <attr name="shadowRadius" format="float" />
         <attr name="backgroundDimAmount" format="float" />
 
-        <attr name="keyLetterStyle" format="enum">
+        <attr name="keyTextStyle" format="enum">
             <!-- This should be aligned with Typeface.NORMAL etc. -->
             <enum name="normal" value="0" />
             <enum name="bold" value="1" />
@@ -131,8 +139,6 @@
         <attr name="verticalGap" format="dimension|fraction" />
         <!-- Popup keyboard layout template -->
         <attr name="popupKeyboardTemplate" format="reference" />
-        <!-- Popup hint icon -->
-        <attr name="popupHintIcon" format="reference" />
         <!-- Locale of the keyboard layout -->
         <attr name="keyboardLocale" format="string" />
     </declare-styleable>
@@ -163,24 +169,20 @@
         <attr name="keyOutputText" format="string" />
         <!-- The label to display on the key. -->
         <attr name="keyLabel" format="string" />
-        <!-- The key label option -->
+        <!-- The hint letter to display on the key in conjunction with the label. -->
+        <attr name="keyHintLetter" format="string" />
+        <!-- The key label option. -->
         <attr name="keyLabelOption" format="integer">
-            <!-- This should be aligned with KeyboardView.KEY_LABEL_OPTION_* -->
+            <!-- This should be aligned with Key.LABEL_OPTION_* -->
             <flag name="alignLeft" value="0x01" />
             <flag name="alignRight" value="0x02" />
             <flag name="alignBottom" value="0x08" />
             <flag name="fontNormal" value="0x10" />
             <flag name="popupHint" value="0x20" />
+            <flag name="hasUppercaseLetter" value="0x40" />
         </attr>
-        <!-- The unicode that this key generates in manual temporary upper case mode. -->
-        <attr name="manualTemporaryUpperCaseCode" format="integer" />
         <!-- The icon to display on the key instead of the label. -->
         <attr name="keyIcon" format="reference" />
-        <!-- The hint icon to display on the key in conjunction with the label -->
-        <attr name="keyHintIcon" format="reference" />
-        <!-- The hint icon to display on the key when keyboard is in manual temporary upper case
-             mode. -->
-        <attr name="manualTemporaryUpperCaseHintIcon" format="reference" />
         <!-- The key style to specify a set of key attributes defined by <key_style/> -->
         <attr name="keyStyle" format="string" />
         <!-- Shift key icon for shifted state -->
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index e26cad3..a76c78a 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -44,7 +44,9 @@
     <dimen name="keyboard_vertical_correction">-0.05in</dimen>
 
     <fraction name="key_letter_ratio">45%</fraction>
-    <fraction name="key_label_text_ratio">29%</fraction>
+    <fraction name="key_label_ratio">29%</fraction>
+    <fraction name="key_hint_letter_ratio">23%</fraction>
+    <fraction name="key_uppercase_letter_ratio">35%</fraction>
     <!-- left or right padding of label alignment -->
     <dimen name="key_label_horizontal_alignment_padding">21dip</dimen>
     <dimen name="key_preview_height">80sp</dimen>
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index 37f1fe3..6f973d9 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -17,7 +17,6 @@
 <resources>
     <!-- Theme "Basic" -->
     <style name="Keyboard">
-        <item name="popupHintIcon">@drawable/hint_popup</item>
     </style>
     <style name="LatinKeyboard">
         <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
@@ -33,13 +32,19 @@
         <item name="android:background">@drawable/keyboard_background</item>
         <item name="keyBackground">@drawable/btn_keyboard_key</item>
         <item name="keyLetterRatio">@fraction/key_letter_ratio</item>
-        <item name="keyLetterStyle">normal</item>
+        <item name="keyLabelRatio">@fraction/key_label_ratio</item>
+        <item name="keyHintLetterRatio">@fraction/key_hint_letter_ratio</item>
+        <item name="keyUppercaseLetterRatio">@fraction/key_uppercase_letter_ratio</item>
+        <item name="keyTextStyle">normal</item>
         <item name="keyTextColor">#FFFFFFFF</item>
-        <item name="keyTextColorDisabled">#FFFFFFFF</item>
+        <item name="keyTextInactivatedColor">#FFFFFFFF</item>
+        <item name="keyHintLetterColor">#80000000</item>
+        <item name="keyUppercaseLetterInactivatedColor">#66E0E4E5</item>
+        <item name="keyUppercaseLetterActivatedColor">#CCE0E4E5</item>
+        <item name="keyPopupHintIcon">@drawable/hint_popup</item>
         <item name="keyPreviewLayout">@layout/key_preview</item>
         <item name="keyPreviewOffset">@dimen/key_preview_offset</item>
         <item name="keyPreviewHeight">@dimen/key_preview_height</item>
-        <item name="labelTextRatio">@fraction/key_label_text_ratio</item>
         <item name="popupLayout">@layout/keyboard_popup</item>
         <item name="keyHysteresisDistance">@dimen/key_hysteresis_distance</item>
         <item name="verticalCorrection">@dimen/keyboard_vertical_correction</item>
@@ -91,7 +96,7 @@
     <style name="KeyboardView.Stone" parent="KeyboardView">
         <item name="keyBackground">@drawable/btn_keyboard_key_stone</item>
         <item name="keyTextColor">@color/latinkeyboard_key_color_black</item>
-        <item name="keyTextColorDisabled">#FF808080</item>
+        <item name="keyTextInactivatedColor">#FF808080</item>
         <item name="shadowColor">@color/latinkeyboard_key_color_white</item>
         <item name="colorScheme">black</item>
     </style>
@@ -102,20 +107,19 @@
     </style>
     <!-- Theme "Stone bold" -->
     <style name="KeyboardView.Stone.Bold" parent="KeyboardView.Stone">
-        <item name="keyLetterStyle">bold</item>
+        <item name="keyTextStyle">bold</item>
     </style>
     <!-- Theme "Gingerbread" -->
     <style name="KeyboardView.Gingerbread" parent="KeyboardView">
         <item name="android:background">@drawable/keyboard_dark_background</item>
         <item name="keyBackground">@drawable/btn_keyboard_key_gingerbread</item>
-        <item name="keyLetterStyle">bold</item>
+        <item name="keyTextStyle">bold</item>
     </style>
     <style name="PopupMiniKeyboardView.Gingerbread" parent="PopupMiniKeyboardView">
         <item name="android:background">@null</item>
     </style>
     <!-- Theme "Honeycomb" -->
     <style name="Keyboard.Honeycomb" parent="Keyboard" >
-        <item name="popupHintIcon">@drawable/hint_popup_holo</item>
     </style>
     <style name="LatinKeyboard.Honeycomb" parent="LatinKeyboard">
         <item name="autoCorrectionSpacebarLedIcon">@null</item>
@@ -124,10 +128,14 @@
     <style name="KeyboardView.Honeycomb" parent="KeyboardView">
         <item name="android:background">@drawable/keyboard_background_holo</item>
         <item name="keyBackground">@drawable/btn_keyboard_key_honeycomb</item>
+        <item name="keyTextStyle">bold</item>
+        <item name="keyTextInactivatedColor">#66E0E4E5</item>
+        <item name="keyHintLetterColor">#80000000</item>
+        <item name="keyUppercaseLetterInactivatedColor">#66E0E4E5</item>
+        <item name="keyUppercaseLetterActivatedColor">#FFFFFFFF</item>
+        <item name="keyPopupHintIcon">@drawable/hint_popup_holo</item>
         <item name="keyPreviewHeight">@dimen/key_preview_height_holo</item>
         <item name="keyPreviewOffset">@dimen/key_preview_offset_holo</item>
-        <item name="keyTextColorDisabled">#FF63666D</item>
-        <item name="keyLetterStyle">bold</item>
         <item name="shadowColor">#00000000</item>
         <item name="shadowRadius">0.0</item>
     </style>