Separate functional key background from normal one

This CL also moves spacebarBackground attribute from MainKeyboardView
to KeyboardView.

This CL must be checked in together with I48c383ca97.

Bug: 14419121
Change-Id: Id356d0086a8fb21375fb5c66076873258fb3d63e
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 769a1d9..79cc139 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -41,13 +41,16 @@
     </declare-styleable>
 
     <declare-styleable name="KeyboardView">
-        <!-- Image for the key. This image needs to be a {@link StateListDrawable}, with the
-             following possible states: normal, pressed, checkable, checkable+pressed,
+        <!-- Background image for the key. This image needs to be a {@link StateListDrawable},
+             with the following possible states: normal, pressed, checkable, checkable+pressed,
              checkable+checked, checkable+checked+pressed. -->
         <attr name="keyBackground" format="reference" />
-        <!-- Image for the functional key used in Emoji layout. -->
-        <attr name="keyBackgroundEmojiFunctional" format="reference" />
-
+        <!-- Background image for the functional key. This image needs to be a
+             {@link StateListDrawable}, with the following possible states: normal, pressed. -->
+        <attr name="functionalKeyBackground" format="reference" />
+        <!-- Background image for the spacebar.  This image needs to be a
+             {@link StateListDrawable}, with the following possible states: normal, pressed. -->
+        <attr name="spacebarBackground" format="reference" />
         <!-- Horizontal padding of left/right aligned key label to the edge of the key. -->
         <attr name="keyLabelHorizontalPadding" format="dimension" />
         <!-- Right padding of hint letter to the edge of the key.-->
@@ -76,8 +79,6 @@
         <attr name="languageOnSpacebarTextColor" format="color" />
         <attr name="languageOnSpacebarTextShadowRadius" format="float" />
         <attr name="languageOnSpacebarTextShadowColor" format="color" />
-        <!-- Background image for the spacebar. -->
-        <attr name="spacebarBackground" format="reference" />
         <!-- Fadeout animator for spacebar language label. -->
         <attr name="languageOnSpacebarFinalAlpha" format="integer" />
         <attr name="languageOnSpacebarFadeoutAnimator" format="reference" />
diff --git a/java/res/values/themes-common.xml b/java/res/values/themes-common.xml
index 76abb10..df26fb3 100644
--- a/java/res/values/themes-common.xml
+++ b/java/res/values/themes-common.xml
@@ -109,12 +109,7 @@
     <style name="KeyPreviewTextView" />
     <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
          for instance delete button, need themed {@link KeyboardView} attributes. -->
-    <style
-        name="EmojiPalettesView"
-        parent="KeyboardView"
-    >
-        <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
-    </style>
+    <style name="EmojiPalettesView" />
     <style name="MoreKeysKeyboard" />
     <style
         name="MoreKeysKeyboardView"
diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml
index d7943ee..560cfc5 100644
--- a/java/res/values/themes-ics.xml
+++ b/java/res/values/themes-ics.xml
@@ -48,6 +48,8 @@
     >
         <item name="android:background">@drawable/keyboard_background_holo</item>
         <item name="keyBackground">@drawable/btn_keyboard_key_ics</item>
+        <item name="functionalKeyBackground">@drawable/btn_keyboard_key_functional_ics</item>
+        <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_ics</item>
         <item name="keyTypeface">bold</item>
         <item name="keyTextColor">@color/key_text_color_holo</item>
         <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_holo</item>
@@ -73,7 +75,6 @@
         <item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item>
         <item name="languageOnSpacebarTextShadowRadius">1.0</item>
         <item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
-        <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_ics</item>
     </style>
     <style
         name="KeyPreviewTextView.ICS"
@@ -85,9 +86,8 @@
          for instance delete button, need themed {@link KeyboardView} attributes. -->
     <style
         name="EmojiPalettesView.ICS"
-        parent="KeyboardView.ICS"
+        parent="MainKeyboardView.ICS"
     >
-        <item name="keyBackgroundEmojiFunctional">@drawable/btn_keyboard_key_functional_ics</item>
         <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
     </style>
     <style
diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml
index 13500fe..453e5cb 100644
--- a/java/res/values/themes-klp.xml
+++ b/java/res/values/themes-klp.xml
@@ -48,6 +48,8 @@
     >
         <item name="android:background">@drawable/keyboard_background_holo</item>
         <item name="keyBackground">@drawable/btn_keyboard_key_klp</item>
+        <item name="functionalKeyBackground">@drawable/btn_keyboard_key_functional_klp</item>
+        <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_klp</item>
         <item name="keyTypeface">bold</item>
         <item name="keyTextColor">@color/key_text_color_holo</item>
         <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_holo</item>
@@ -73,7 +75,6 @@
         <item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item>
         <item name="languageOnSpacebarTextShadowRadius">1.0</item>
         <item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
-        <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_klp</item>
     </style>
     <style
         name="KeyPreviewTextView.KLP"
@@ -85,9 +86,8 @@
          for instance delete button, need themed {@link KeyboardView} attributes. -->
     <style
         name="EmojiPalettesView.KLP"
-        parent="KeyboardView.KLP"
+        parent="MainKeyboardView.KLP"
     >
-        <item name="keyBackgroundEmojiFunctional">@drawable/btn_keyboard_key_functional_klp</item>
         <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
     </style>
     <style
diff --git a/java/res/values/themes-lmp.xml b/java/res/values/themes-lmp.xml
index c05190b..a9b8a93 100644
--- a/java/res/values/themes-lmp.xml
+++ b/java/res/values/themes-lmp.xml
@@ -48,6 +48,8 @@
     >
         <item name="android:background">@color/keyboard_background_lmp</item>
         <item name="keyBackground">@drawable/btn_keyboard_key_lmp</item>
+        <item name="functionalKeyBackground">@drawable/btn_keyboard_key_functional_lmp</item>
+        <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_lmp</item>
         <item name="keyTypeface">bold</item>
         <item name="keyTextColor">@color/key_text_color_holo</item>
         <item name="keyTextInactivatedColor">@color/key_text_inactive_color_lmp</item>
@@ -73,7 +75,6 @@
         <item name="languageOnSpacebarTextColor">@color/key_text_inactive_color_lmp</item>
         <!-- A negative value to disable text shadow layer. -->
         <item name="languageOnSpacebarTextShadowRadius">-1.0</item>
-        <item name="spacebarBackground">@drawable/btn_keyboard_spacebar_lmp</item>
     </style>
     <style
         name="KeyPreviewTextView.LMP"
@@ -85,9 +86,8 @@
          for instance delete button, need themed {@link KeyboardView} attributes. -->
     <style
         name="EmojiPalettesView.LMP"
-        parent="KeyboardView.LMP"
+        parent="MainKeyboardView.LMP"
     >
-        <item name="keyBackgroundEmojiFunctional">@drawable/btn_keyboard_key_functional_lmp</item>
         <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
     </style>
     <style