Merge commit 'goog/master'

main
satok 2010-04-16 15:55:35 +09:00
commit 19266dc860
5 changed files with 173 additions and 9 deletions

View File

@ -63,8 +63,7 @@
<ProgressBar android:id="@+id/progress" <ProgressBar android:id="@+id/progress"
android:layout_height="60dip" android:layout_height="60dip"
android:layout_width="60dip" android:layout_width="60dip"
android:layout_marginTop="20dip" android:layout_gravity="center"
android:layout_gravity="center_horizontal"
android:visibility="gone" android:visibility="gone"
android:indeterminate="true" android:indeterminate="true"
android:indeterminateOnly="false" android:indeterminateOnly="false"

View File

@ -76,7 +76,7 @@
<string name="tip_to_start_typing" msgid="7213843601369174313"><b>"¡Pruébalo!"</b></string> <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_go_key" msgid="1635148082137219148">"Ir"</string>
<string name="label_next_key" msgid="362972844525672568">"Sig."</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_send_key" msgid="2815056534433717444">"Enviar"</string>
<string name="label_symbol_key" msgid="6175820506864489453">"?123"</string> <string name="label_symbol_key" msgid="6175820506864489453">"?123"</string>
<string name="label_phone_key" msgid="4275497665515080551">"123"</string> <string name="label_phone_key" msgid="4275497665515080551">"123"</string>

164
java/res/xml-iw/kbd_qwerty.xml Executable file
View File

@ -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>

View File

@ -192,12 +192,12 @@ public class LatinKeyboardView extends KeyboardView {
mLastY = (int) me.getY(); mLastY = (int) me.getY();
invalidate(); invalidate();
} }
// If an extension keyboard is visible or this is an extension keyboard, don't look // 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 // for sudden jumps. Otherwise, if there was a sudden jump, return without processing the
// actual motion event. // actual motion event.
if (!mExtensionVisible && !mIsExtensionType if (!mExtensionVisible && !mIsExtensionType
&& handleSuddenJump(me)) return true; && handleSuddenJump(me)) return true;
// Reset any bounding box controls in the keyboard // Reset any bounding box controls in the keyboard
if (me.getAction() == MotionEvent.ACTION_DOWN) { if (me.getAction() == MotionEvent.ACTION_DOWN) {
keyboard.keyReleased(); keyboard.keyReleased();
@ -219,7 +219,9 @@ public class LatinKeyboardView extends KeyboardView {
if (keyboard.getExtension() == 0) { if (keyboard.getExtension() == 0) {
return super.onTouchEvent(me); 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) { if (mExtensionVisible) {
int action = me.getAction(); int action = me.getAction();
if (mFirstEvent) action = MotionEvent.ACTION_DOWN; if (mFirstEvent) action = MotionEvent.ACTION_DOWN;

View File

@ -274,12 +274,11 @@ public class RecognitionView {
final int count = (endIndex - startIndex) / numSamplePerWave; final int count = (endIndex - startIndex) / numSamplePerWave;
final float deltaX = 1.0f * w / count; final float deltaX = 1.0f * w / count;
int yMax = h / 2 - 10; int yMax = h / 2 - 8;
Path path = new Path(); Path path = new Path();
c.translate(0, yMax); c.translate(0, yMax);
float x = 0; float x = 0;
path.moveTo(x, 0); path.moveTo(x, 0);
yMax -= 10;
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
final int avabs = getAverageAbs(waveBuffer, startIndex, i , numSamplePerWave); final int avabs = getAverageAbs(waveBuffer, startIndex, i , numSamplePerWave);
int sign = ( (i & 01) == 0) ? -1 : 1; int sign = ( (i & 01) == 0) ? -1 : 1;
@ -297,8 +296,8 @@ public class RecognitionView {
mImage.setImageBitmap(b); mImage.setImageBitmap(b);
mImage.setVisibility(View.VISIBLE); mImage.setVisibility(View.VISIBLE);
MarginLayoutParams mProgressParams = (MarginLayoutParams)mProgress.getLayoutParams(); MarginLayoutParams mProgressParams = (MarginLayoutParams)mProgress.getLayoutParams();
mProgressParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mProgressParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
-h / 2 - 18, mContext.getResources().getDisplayMetrics()); -h , mContext.getResources().getDisplayMetrics());
// Tweak the padding manually to fill out the whole view horizontally. // Tweak the padding manually to fill out the whole view horizontally.
// TODO: Do this in the xml layout instead. // TODO: Do this in the xml layout instead.