Add a new theme for Gingerbread

bug: 2959293

Change-Id: I8aef19a7485ffd5639a177aee21103b3a1e04cf2
diff --git a/java/res/drawable/btn_keyboard_key_gingerbread.xml b/java/res/drawable/btn_keyboard_key_gingerbread.xml
new file mode 100644
index 0000000..24a5479
--- /dev/null
+++ b/java/res/drawable/btn_keyboard_key_gingerbread.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <!-- Toggle keys. Use checkable/checked state. -->
+
+    <item android:state_checkable="true" android:state_checked="true"
+          android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_on" />
+    <item android:state_checkable="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_off" />
+    <item android:state_checkable="true" android:state_checked="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_on" />
+    <item android:state_checkable="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_off" />
+
+    <!-- Normal keys -->
+
+    <item android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_light_pressed" />
+    <item android:drawable="@drawable/btn_keyboard_key_light_normal" />
+</selector>
diff --git a/java/res/layout/input_gingerbread.xml b/java/res/layout/input_gingerbread.xml
new file mode 100755
index 0000000..8f59cae
--- /dev/null
+++ b/java/res/layout/input_gingerbread.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<com.android.inputmethod.latin.LatinKeyboardView
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+        android:id="@+id/LatinkeyboardBaseView"
+        android:layout_alignParentBottom="true"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/keyboard_dark_background"
+        android:textStyle="bold"
+
+        latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
+        latin:keyTextStyle="bold"
+        />
diff --git a/java/res/layout/input_gingerbread_popup.xml b/java/res/layout/input_gingerbread_popup.xml
new file mode 100755
index 0000000..0f0f080
--- /dev/null
+++ b/java/res/layout/input_gingerbread_popup.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<LinearLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@drawable/keyboard_popup_panel_background"
+        >
+    <com.android.inputmethod.latin.LatinKeyboardBaseView
+            xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+            android:id="@+id/LatinKeyboardBaseView"
+            android:layout_alignParentBottom="true"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/keyboard_dark_background"
+
+            latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
+            latin:popupLayout="@layout/input_gingerbread_popup"
+        />
+    <ImageButton android:id="@+id/closeButton"
+        android:background="@android:color/transparent"
+        android:src="@drawable/btn_close"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_marginLeft="8dp"
+        android:clickable="true"
+        />
+</LinearLayout>
diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml
index 343a940..5ca9624 100644
--- a/java/res/values/colors.xml
+++ b/java/res/values/colors.xml
@@ -18,9 +18,9 @@
 */
 -->
 <resources>
-    <color name="candidate_normal">#FF000000</color>
-    <color name="candidate_recommended">#FFE35900</color>
-    <color name="candidate_other">#ff808080</color>
+    <color name="candidate_normal">#FFFFFFFF</color>
+    <color name="candidate_recommended">#FFF07020</color>
+    <color name="candidate_other">#ffB05010</color>
     <color name="latinkeyboard_transparent">#00000000</color>
     <color name="latinkeyboard_bar_language_shadow_white">#80000000</color>
     <color name="latinkeyboard_bar_language_shadow_black">#80FFFFFF</color>
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index ef5127e..0952114 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -337,17 +337,20 @@
     <!-- Description for enabling to send user statistics to Google. -->
     <string name="prefs_description_log">Help improve this input method editor by automatically sending usage statistics and crash reports to Google.</string>
 
+    <!-- Description for keyboard theme switcher -->
     <string name="keyboard_layout">Keyboard Theme</string>
     <string name="layout_basic" translatable="false">Basic</string>
     <string name="layout_high_contrast" translatable="false">Basic (High Contrast)</string>
-    <string name="layout_stone_bold"  translatable="false">Default (bold)</string>
-    <string name="layout_stone_normal"  translatable="false">Default (normal)</string>
+    <string name="layout_stone_bold"  translatable="false">Stone (bold)</string>
+    <string name="layout_stone_normal"  translatable="false">Stone (normal)</string>
+    <string name="layout_gingerbread"  translatable="false">Gingerbread</string>
 
     <string-array name="keyboard_layout_modes" translatable="false">
         <item>@string/layout_basic</item>
         <item>@string/layout_high_contrast</item>
         <item>@string/layout_stone_normal</item>
         <item>@string/layout_stone_bold</item>
+        <item>@string/layout_gingerbread</item>
     </string-array>
 
     <string-array name="keyboard_layout_modes_values" translatable="false">
@@ -355,6 +358,7 @@
         <item>1</item>
         <item>2</item>
         <item>3</item>
+        <item>4</item>
     </string-array>
 
     <string name="subtype_mode_keyboard">keyboard</string>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index c4ffeef..a3c956e 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -67,7 +67,7 @@
             android:persistent="true"
             android:entryValues="@array/keyboard_layout_modes_values"
             android:entries="@array/keyboard_layout_modes"
-            android:defaultValue="3"
+            android:defaultValue="4"
             />
 
     <PreferenceScreen
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index a50c5aa..223198b 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -44,11 +44,11 @@
     public static final int KEYBOARDMODE_IM = R.id.mode_im;
     public static final int KEYBOARDMODE_WEB = R.id.mode_webentry;
 
-    public static final String DEFAULT_LAYOUT_ID = "3";
+    public static final String DEFAULT_LAYOUT_ID = "4";
     public static final String PREF_KEYBOARD_LAYOUT = "keyboard_layout";
     private static final int[] THEMES = new int [] {
         R.layout.input_basic, R.layout.input_basic_highcontrast, R.layout.input_stone_normal,
-        R.layout.input_stone_bold};
+        R.layout.input_stone_bold, R.layout.input_gingerbread};
 
     // Ids for each characters' color in the keyboard
     private static final int CHAR_THEME_COLOR_WHITE = 0;
@@ -78,7 +78,7 @@
 
     Context mContext;
     LatinIME mInputMethodService;
-    
+
     private KeyboardId mSymbolsId;
     private KeyboardId mSymbolsShiftedId;