Merge "Tweak base line of key top letter"
diff --git a/java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png b/java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png
new file mode 100644
index 0000000..bb58f00
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png
Binary files differ
diff --git a/java/res/drawable/btn_candidate_holo.xml b/java/res/drawable/btn_candidate_holo.xml
new file mode 100644
index 0000000..66cd246
--- /dev/null
+++ b/java/res/drawable/btn_candidate_holo.xml
@@ -0,0 +1,27 @@
+<?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.
+*/
+-->
+
+<selector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+>
+    <item
+        android:state_pressed="true"
+        android:drawable="@drawable/btn_keyboard_key_popup_selected_holo" />
+</selector>
diff --git a/java/res/layout-xlarge/candidate.xml b/java/res/layout-xlarge/candidate.xml
new file mode 100644
index 0000000..74532a1
--- /dev/null
+++ b/java/res/layout-xlarge/candidate.xml
@@ -0,0 +1,60 @@
+<?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="@dimen/candidate_strip_height"
+    android:orientation="horizontal"
+    android:paddingRight="@dimen/candidate_padding"
+>
+    <ImageView
+        android:id="@+id/candidate_divider"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/candidate_strip_height"
+        android:visibility="gone"
+        android:focusable="false"
+        android:clickable="false"
+        android:src="@drawable/keyboard_suggest_strip_divider"
+        android:gravity="center_vertical|center_horizontal" />
+    <Button
+        android:id="@+id/candidate_word"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/candidate_strip_height"
+        android:minWidth="@dimen/candidate_min_width"
+        android:textSize="@dimen/candidate_text_size"
+        android:textColor="@color/candidate_normal"
+        android:background="@drawable/btn_candidate_holo"
+        android:focusable="true"
+        android:clickable="true"
+        android:gravity="center_vertical|center_horizontal"
+        android:paddingLeft="@dimen/candidate_padding" />
+    <TextView
+        android:id="@+id/candidate_debug_info"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:visibility="gone"
+        android:textSize="10dip"
+        android:textColor="#ff808080"
+        android:focusable="false"
+        android:clickable="false"
+        android:gravity="bottom"
+        android:paddingLeft="4dip" />
+</LinearLayout>
diff --git a/java/res/layout-xlarge/candidate_preview.xml b/java/res/layout-xlarge/candidate_preview.xml
new file mode 100644
index 0000000..61d5f8e
--- /dev/null
+++ b/java/res/layout-xlarge/candidate_preview.xml
@@ -0,0 +1,29 @@
+<?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.
+*/
+-->
+
+<TextView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:textSize="18sp"
+    android:textColor="?android:attr/textColorPrimaryInverse"
+    android:minWidth="32dip"
+    android:gravity="center"
+    android:background="@drawable/keyboard_popup_panel_background_holo" />
diff --git a/java/res/layout-xlarge/candidates.xml b/java/res/layout-xlarge/candidates.xml
new file mode 100644
index 0000000..e2ddb84
--- /dev/null
+++ b/java/res/layout-xlarge/candidates.xml
@@ -0,0 +1,45 @@
+<?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:orientation="horizontal"
+    android:layout_width="match_parent"
+    android:layout_height="@dimen/candidate_strip_height"
+    android:background="@drawable/keyboard_suggest_strip_holo"
+    android:paddingRight="@dimen/candidate_strip_padding"
+    android:paddingLeft="@dimen/candidate_strip_padding"
+>
+    <HorizontalScrollView
+        android:id="@+id/candidates_scroll_view"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/candidate_strip_height"
+        android:fadingEdge="horizontal"
+        android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length"
+        android:scrollbars="none"
+    >
+        <com.android.inputmethod.latin.CandidateView
+            android:id="@+id/candidates"
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/candidate_strip_height"
+            android:background="@drawable/keyboard_suggest_strip_holo" />
+    </HorizontalScrollView>
+</LinearLayout>
diff --git a/java/res/xml-xlarge/kbd_key_styles.xml b/java/res/xml-xlarge/kbd_key_styles.xml
index 9ff3340..be46111 100644
--- a/java/res/xml-xlarge/kbd_key_styles.xml
+++ b/java/res/xml-xlarge/kbd_key_styles.xml
@@ -54,8 +54,7 @@
                 latin:styleName="spaceKeyStyle"
                 latin:codes="@integer/key_space"
                 latin:keyIcon="@drawable/sym_keyboard_space_holo"
-                latin:iconPreview="@drawable/sym_keyboard_feedback_space"
-                latin:parentStyle="functionalKeyStyle" />
+                latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
             <key-style
                 latin:styleName="nonSpecialBackgroundSpaceKeyStyle"
                 latin:codes="@integer/key_space"
@@ -105,8 +104,7 @@
                 latin:styleName="spaceKeyStyle"
                 latin:codes="@integer/key_space"
                 latin:keyIcon="@drawable/sym_bkeyboard_space"
-                latin:iconPreview="@drawable/sym_keyboard_feedback_space"
-                latin:parentStyle="functionalKeyStyle" />
+                latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
             <key-style
                 latin:styleName="nonSpecialBackgroundSpaceKeyStyle"
                 latin:codes="@integer/key_space"
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index a381821..482b35f 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -29,7 +29,7 @@
         android:isDefault="@bool/im_is_default">
     <!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default
          subtype.-->
-    <subtype android:icon="@drawable/ic_subtype_keyboard_en_us"
+    <subtype android:icon="@drawable/ic_subtype_keyboard_en_gb"
             android:label="@string/subtype_mode_en_US_keyboard"
             android:imeSubtypeLocale="en_US"
             android:imeSubtypeMode="keyboard"
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 784077a..3f47ea3 100644
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -282,6 +282,7 @@
             return;
 
         final TextView previewText = mPreviewText;
+        previewText.setTextColor(mColorNormal);
         previewText.setText(word);
         previewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
                 MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
diff --git a/java/src/com/android/inputmethod/latin/UserDictionary.java b/java/src/com/android/inputmethod/latin/UserDictionary.java
index e03f564..56ee5b9 100644
--- a/java/src/com/android/inputmethod/latin/UserDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserDictionary.java
@@ -26,14 +26,16 @@
 
 public class UserDictionary extends ExpandableDictionary {
     
-    private static final String[] PROJECTION = {
-        Words._ID,
+    private static final String[] PROJECTION_QUERY = {
         Words.WORD,
-        Words.FREQUENCY
+        Words.FREQUENCY,
     };
     
-    private static final int INDEX_WORD = 1;
-    private static final int INDEX_FREQUENCY = 2;
+    private static final String[] PROJECTION_ADD = {
+        Words._ID,
+        Words.FREQUENCY,
+        Words.LOCALE,
+    };
     
     private ContentObserver mObserver;
     private String mLocale;
@@ -67,7 +69,7 @@
     @Override
     public void loadDictionaryAsync() {
         Cursor cursor = getContext().getContentResolver()
-                .query(Words.CONTENT_URI, PROJECTION, "(locale IS NULL) or (locale=?)",
+                .query(Words.CONTENT_URI, PROJECTION_QUERY, "(locale IS NULL) or (locale=?)",
                         new String[] { mLocale }, null);
         addWords(cursor);
     }
@@ -100,7 +102,7 @@
         new Thread("addWord") {
             @Override
             public void run() {
-                Cursor cursor = contentResolver.query(Words.CONTENT_URI, PROJECTION,
+                Cursor cursor = contentResolver.query(Words.CONTENT_URI, PROJECTION_ADD,
                         "word=? and ((locale IS NULL) or (locale=?))",
                         new String[] { word, mLocale }, null);
                 if (cursor != null && cursor.moveToFirst()) {
@@ -139,9 +141,11 @@
 
         final int maxWordLength = getMaxWordLength();
         if (cursor.moveToFirst()) {
+            final int indexWord = cursor.getColumnIndex(Words.WORD);
+            final int indexFrequency = cursor.getColumnIndex(Words.FREQUENCY);
             while (!cursor.isAfterLast()) {
-                String word = cursor.getString(INDEX_WORD);
-                int frequency = cursor.getInt(INDEX_FREQUENCY);
+                String word = cursor.getString(indexWord);
+                int frequency = cursor.getInt(indexFrequency);
                 // Safeguard against adding really long words. Stack may overflow due
                 // to recursion
                 if (word.length() < maxWordLength) {