Merge commit 'goog/master'
diff --git a/java/res/layout/recognition_status.xml b/java/res/layout/recognition_status.xml
index 1ec06ba..49af773 100644
--- a/java/res/layout/recognition_status.xml
+++ b/java/res/layout/recognition_status.xml
@@ -63,8 +63,7 @@
     <ProgressBar android:id="@+id/progress"
         android:layout_height="60dip"
         android:layout_width="60dip"
-        android:layout_marginTop="20dip"
-        android:layout_gravity="center_horizontal"
+        android:layout_gravity="center"
         android:visibility="gone"
         android:indeterminate="true"
         android:indeterminateOnly="false"
diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml
index d3d7944..8a1fb9d 100644
--- a/java/res/values-es/strings.xml
+++ b/java/res/values-es/strings.xml
@@ -76,7 +76,7 @@
     <string name="tip_to_start_typing" msgid="7213843601369174313"><b>"¡Pruébalo!"</b></string>
     <string name="label_go_key" msgid="1635148082137219148">"Ir"</string>
     <string name="label_next_key" msgid="362972844525672568">"Sig."</string>
-    <string name="label_done_key" msgid="2441578748772529288">"Hecho"</string>
+    <string name="label_done_key" msgid="2441578748772529288">"Listo"</string>
     <string name="label_send_key" msgid="2815056534433717444">"Enviar"</string>
     <string name="label_symbol_key" msgid="6175820506864489453">"?123"</string>
     <string name="label_phone_key" msgid="4275497665515080551">"123"</string>
diff --git a/java/res/xml-iw/kbd_qwerty.xml b/java/res/xml-iw/kbd_qwerty.xml
new file mode 100755
index 0000000..3cec7cd
--- /dev/null
+++ b/java/res/xml-iw/kbd_qwerty.xml
@@ -0,0 +1,164 @@
+<?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.
+*/
+-->
+
+<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
+    android:keyWidth="10%p"
+    android:horizontalGap="0px"
+    android:verticalGap="0px"
+    android:keyHeight="@dimen/key_height"
+    >
+
+    <Row>
+        <Key android:keyLabel="ק" 
+	     android:horizontalGap="5%p"
+	     android:keyEdgeFlags="left"/>
+        <Key android:keyLabel="ר"/>
+        <Key android:keyLabel="א"/>
+        <Key android:keyLabel="ט"/>
+        <Key android:keyLabel="ו"/>
+        <Key android:keyLabel="ן"/>
+        <Key android:keyLabel="ם"/>
+        <Key android:keyLabel="פ"/>
+        <Key android:codes="-5" 
+	     android:horizontalGap="1.25%p"
+	     android:keyIcon="@drawable/sym_keyboard_delete"
+            android:keyWidth="13.75%p" android:keyEdgeFlags="right"
+            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            android:isRepeatable="true"/>
+    </Row>
+
+    <Row>
+        <Key android:keyLabel="ש" android:keyEdgeFlags="left"/>
+        <Key android:keyLabel="ד"/>
+        <Key android:keyLabel="ג"/>
+        <Key android:keyLabel="כ"/>
+        <Key android:keyLabel="ע"/>
+        <Key android:keyLabel="י"/>
+        <Key android:keyLabel="ח"/>
+        <Key android:keyLabel="ל"/>
+        <Key android:keyLabel="ך"/>
+        <Key android:keyLabel="ף" android:keyEdgeFlags="right"/>
+    </Row>
+    
+    <Row>
+        <Key android:keyLabel="ז" android:horizontalGap="5%p" android:keyEdgeFlags="left"/>
+        <Key android:keyLabel="ס"/>
+        <Key android:keyLabel="ב"/>
+        <Key android:keyLabel="ה"/>
+        <Key android:keyLabel="נ"/>
+        <Key android:keyLabel="מ"/>
+        <Key android:keyLabel="צ"/>
+        <Key android:keyLabel="ת"/>
+        <Key android:keyLabel="ץ" android:keyEdgeFlags="right"/>
+    </Row>
+
+    <Row android:keyboardMode="@+id/mode_normal" android:rowEdgeFlags="bottom">
+        <Key android:codes="-2" android:keyLabel="@string/label_symbol_key" 
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="_"
+                android:keyWidth="20%p" android:keyEdgeFlags="left"/>
+        <Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_keyboard_globe"
+                android:keyWidth="10%p"/>
+        <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
+                android:iconPreview="@drawable/sym_keyboard_feedback_space"
+                android:keyWidth="40%p" android:isRepeatable="true"/>
+        <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_punctuation" 
+                android:keyWidth="10%p"/>
+        <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return"
+                android:iconPreview="@drawable/sym_keyboard_feedback_return"
+                android:keyWidth="20%p" android:keyEdgeFlags="right"/>
+    </Row>
+
+    <Row android:keyboardMode="@+id/mode_url" android:rowEdgeFlags="bottom">
+        <Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="_"
+                android:keyWidth="20%p" android:keyEdgeFlags="left"/>
+        <Key android:keyLabel="/" android:keyWidth="10%p"/>
+        <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
+                android:iconPreview="@drawable/sym_keyboard_feedback_space"
+                android:keyWidth="20%p" android:isRepeatable="true"/>
+        <Key android:keyLabel="@string/popular_domain_0"
+                android:keyOutputText="@string/popular_domain_0"
+                android:popupKeyboard="@xml/popup_domains"
+                android:keyWidth="20%p"/>
+        <Key android:keyLabel="." android:popupKeyboard="@xml/popup_punctuation"
+                android:keyWidth="10%p"/>
+        <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return"
+                android:iconPreview="@drawable/sym_keyboard_feedback_return"
+                android:keyWidth="20%p" android:keyEdgeFlags="right"/>
+    </Row>
+
+    <Row android:keyboardMode="@+id/mode_email" android:rowEdgeFlags="bottom">
+        <Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="_"
+                android:keyWidth="20%p" android:keyEdgeFlags="left"/>
+        <Key android:keyLabel="\@" android:keyWidth="10%p"/>
+        <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
+                android:iconPreview="@drawable/sym_keyboard_feedback_space"
+                android:keyWidth="20%p" android:isRepeatable="true"/>
+        <Key android:keyLabel="@string/popular_domain_0"
+                android:keyOutputText="@string/popular_domain_0"
+                android:popupKeyboard="@xml/popup_domains"
+                android:keyWidth="20%p"/>
+        <Key android:keyLabel="." android:popupKeyboard="@xml/popup_punctuation"/>
+        <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return"
+                android:iconPreview="@drawable/sym_keyboard_feedback_return"
+                android:keyWidth="20%p" android:keyEdgeFlags="right"/>
+    </Row>
+
+    <Row android:keyboardMode="@+id/mode_im" android:rowEdgeFlags="bottom">
+        <Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="_"
+                android:keyWidth="20%p" android:keyEdgeFlags="left"/>
+        <Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_keyboard_globe"
+                android:keyWidth="10%p"/>
+        <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
+                android:iconPreview="@drawable/sym_keyboard_feedback_space"
+                android:keyWidth="40%p" android:isRepeatable="true"/>
+        <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_punctuation" 
+                android:keyWidth="10%p"/>
+        <Key android:keyLabel=":-)" android:keyOutputText=":-) "
+                android:popupKeyboard="@xml/popup_smileys"
+                android:keyWidth="20%p" android:keyEdgeFlags="right"/>
+    </Row>
+
+    <Row android:keyboardMode="@+id/mode_webentry" android:rowEdgeFlags="bottom">
+        <Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="_"
+                android:keyWidth="20%p" android:keyEdgeFlags="left"/>
+        <Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_keyboard_globe"
+                android:keyWidth="10%p"/>
+        <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
+                android:iconPreview="@drawable/sym_keyboard_feedback_space"
+                android:keyWidth="20%p" android:isRepeatable="true"/>
+        <Key android:codes="9" android:keyIcon="@drawable/sym_keyboard_tab"
+                android:iconPreview="@drawable/sym_keyboard_feedback_tab"
+                android:keyWidth="20%p"/>
+        <Key android:keyLabel="." android:popupKeyboard="@xml/popup_punctuation"/>
+        <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return"
+                android:iconPreview="@drawable/sym_keyboard_feedback_return"
+                android:keyWidth="20%p" android:keyEdgeFlags="right"/>
+    </Row>
+</Keyboard>
+    
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index 6ba2095..74fc475 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -192,12 +192,12 @@
             mLastY = (int) me.getY();
             invalidate();
         }
+
         // If an extension keyboard is visible or this is an extension keyboard, don't look
         // for sudden jumps. Otherwise, if there was a sudden jump, return without processing the
         // actual motion event.
         if (!mExtensionVisible && !mIsExtensionType
                 && handleSuddenJump(me)) return true;
-
         // Reset any bounding box controls in the keyboard
         if (me.getAction() == MotionEvent.ACTION_DOWN) {
             keyboard.keyReleased();
@@ -219,7 +219,9 @@
         if (keyboard.getExtension() == 0) {
             return super.onTouchEvent(me);
         }
-        if (me.getY() < 0) {
+        // If the motion event is above the keyboard and it's not an UP event coming
+        // even before the first MOVE event into the extension area
+        if (me.getY() < 0 && (mExtensionVisible || me.getAction() != MotionEvent.ACTION_UP)) {
             if (mExtensionVisible) {
                 int action = me.getAction();
                 if (mFirstEvent) action = MotionEvent.ACTION_DOWN;
diff --git a/java/src/com/android/inputmethod/voice/RecognitionView.java b/java/src/com/android/inputmethod/voice/RecognitionView.java
index 1e99c3c..7cec0b0 100644
--- a/java/src/com/android/inputmethod/voice/RecognitionView.java
+++ b/java/src/com/android/inputmethod/voice/RecognitionView.java
@@ -274,12 +274,11 @@
 
         final int count = (endIndex - startIndex) / numSamplePerWave;
         final float deltaX = 1.0f * w / count;
-        int yMax = h / 2 - 10;
+        int yMax = h / 2 - 8;
         Path path = new Path();
         c.translate(0, yMax);
         float x = 0;
         path.moveTo(x, 0);
-        yMax -= 10;
         for (int i = 0; i < count; i++) {
             final int avabs = getAverageAbs(waveBuffer, startIndex, i , numSamplePerWave);
             int sign = ( (i & 01) == 0) ? -1 : 1;
@@ -297,8 +296,8 @@
         mImage.setImageBitmap(b);
         mImage.setVisibility(View.VISIBLE);
         MarginLayoutParams mProgressParams = (MarginLayoutParams)mProgress.getLayoutParams();
-        mProgressParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
-                -h / 2 - 18, mContext.getResources().getDisplayMetrics());
+        mProgressParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
+                -h , mContext.getResources().getDisplayMetrics());
 
         // Tweak the padding manually to fill out the whole view horizontally.
         // TODO: Do this in the xml layout instead.