diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/values-de/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-ja/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-sv/strings.xml | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 7 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | 9 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/PointerTracker.java | 13 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/voice/VoiceInput.java | 16 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/voice/VoiceInputLogger.java | 18 |
8 files changed, 40 insertions, 29 deletions
diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml index 3153d2936..b29bbb501 100644 --- a/java/res/values-de/strings.xml +++ b/java/res/values-de/strings.xml @@ -98,7 +98,7 @@ <string name="voice_server_error" msgid="7807129913977261644">"Serverfehler"</string> <string name="voice_speech_timeout" msgid="8461817525075498795">"Keine Sprache zu hören"</string> <string name="voice_no_match" msgid="4285117547030179174">"Keine Treffer gefunden"</string> - <string name="voice_not_installed" msgid="5552450909753842415">"Sprach-Suche nicht installiert"</string> + <string name="voice_not_installed" msgid="5552450909753842415">"Sprachsuche nicht installiert"</string> <string name="voice_swipe_hint" msgid="6943546180310682021"><b>"Hinweis:"</b>" Ziehen Sie zum Sprechen den Finger über die Tastatur."</string> <string name="voice_punctuation_hint" msgid="1611389463237317754"><b>"Hinweis:"</b>" Versuchen Sie beim nächsten Mal, Satzzeichen wie \"Punkt\", \"Komma\" oder \"Fragezeichen\" per Sprachbefehl einzugeben."</string> <string name="cancel" msgid="6830980399865683324">"Abbrechen"</string> diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml index 2589c89fc..71a67a2f6 100644 --- a/java/res/values-ja/strings.xml +++ b/java/res/values-ja/strings.xml @@ -25,7 +25,7 @@ <string name="english_ime_input_options" msgid="3909945612939668554">"入力オプション"</string> <string name="vibrate_on_keypress" msgid="5258079494276955460">"キー操作バイブ"</string> <string name="sound_on_keypress" msgid="6093592297198243644">"キー操作音"</string> - <string name="popup_on_keypress" msgid="123894815723512944">"キー押下時に文字をポップアップ表示"</string> + <string name="popup_on_keypress" msgid="123894815723512944">"キー押下時ポップアップ"</string> <string name="hit_correction" msgid="4855351009261318389">"入力ミス補正"</string> <string name="hit_correction_summary" msgid="8761701873008070796">"入力間違いを自動修正する"</string> <string name="hit_correction_land" msgid="2567691684825205448">"横表示での入力修正"</string> diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml index eaa3d1961..755ee05db 100644 --- a/java/res/values-sv/strings.xml +++ b/java/res/values-sv/strings.xml @@ -72,7 +72,7 @@ <string name="tip_to_open_keyboard" msgid="6821200275486950452"><b>"Tangentbordet öppnas när du trycker på ett textfält"</b></string> <string name="tip_to_view_accents" msgid="5433158573693308501"><b>"Tryck och håll nere en tangent om du vill visa accenter"\n"(ø, ö, ô, ó och så vidare)"</b></string> <string name="tip_to_open_symbols" msgid="7345139325622444880"><b>"Växla till siffror och symboler med den här tangenten"</b></string> - <string name="tip_to_close_symbols" msgid="5227724217206927185"><b>"Återgå till bokstäver genom att trycka på tangenten en gång till"</b></string> + <string name="tip_to_close_symbols" msgid="5227724217206927185"><b>"Återvänd till bokstäver genom att trycka på tangenten en gång till"</b></string> <string name="tip_to_launch_settings" msgid="8402961128983196128"><b>"Tryck och håll ned tangenten om du vill ändra inställningarna för tangentbordet, till exempel Komplettera automatiskt"</b></string> <string name="tip_to_start_typing" msgid="7213843601369174313"><b>"Testa!"</b></string> <string name="label_go_key" msgid="1635148082137219148">"Kör"</string> diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index b6fee1170..ffca22e45 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1864,13 +1864,14 @@ public class LatinIME extends InputMethodService } public void pickSuggestionManually(int index, CharSequence suggestion) { - if (mAfterVoiceInput && mShowingVoiceSuggestions) mVoiceInput.logNBestChoose(index); List<CharSequence> suggestions = mCandidateView.getSuggestions(); - if (mAfterVoiceInput && !mShowingVoiceSuggestions) { + if (mAfterVoiceInput && mShowingVoiceSuggestions) { mVoiceInput.flushAllTextModificationCounters(); // send this intent AFTER logging any prior aggregated edits. - mVoiceInput.logTextModifiedByChooseSuggestion(suggestion.length()); + mVoiceInput.logTextModifiedByChooseSuggestion(suggestion.toString(), index, + mWordSeparators, + getCurrentInputConnection()); } final boolean correcting = TextEntryState.isCorrecting(); diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index 5a015e93b..b1ef08573 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -226,7 +226,7 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx protected KeyDetector mKeyDetector = new ProximityKeyDetector(); // Swipe gesture detector - private final GestureDetector mGestureDetector; + private GestureDetector mGestureDetector; private final SwipeTracker mSwipeTracker = new SwipeTracker(); private final int mSwipeThreshold; private final boolean mDisambiguateSwipe; @@ -1106,6 +1106,8 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx }); // Override default ProximityKeyDetector. miniKeyboard.mKeyDetector = new MiniKeyboardKeyDetector(mMiniKeyboardSlideAllowance); + // Remove gesture detector on mini-keyboard + miniKeyboard.mGestureDetector = null; Keyboard keyboard; if (popupKey.popupCharacters != null) { @@ -1307,8 +1309,9 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx // Track the last few movements to look for spurious swipes. mSwipeTracker.addMovement(me); - // We must disable gesture detector while mini-keyboard is on the screen. - if (mMiniKeyboard == null && mGestureDetector.onTouchEvent(me)) { + // Gesture detector must be enabled only when mini-keyboard is not on the screen. + if (mMiniKeyboard == null + && mGestureDetector != null && mGestureDetector.onTouchEvent(me)) { dismissKeyPreview(); mHandler.cancelKeyTimers(); return true; diff --git a/java/src/com/android/inputmethod/latin/PointerTracker.java b/java/src/com/android/inputmethod/latin/PointerTracker.java index f6fd5bd7a..90218e4ab 100644 --- a/java/src/com/android/inputmethod/latin/PointerTracker.java +++ b/java/src/com/android/inputmethod/latin/PointerTracker.java @@ -296,18 +296,23 @@ public class PointerTracker { if (mKeyAlreadyProcessed) return; KeyState keyState = mKeyState; - int keyIndex = keyState.onMoveKey(x, y); + final int keyIndex = keyState.onMoveKey(x, y); + final Key oldKey = getKey(keyState.getKeyIndex()); if (isValidKeyIndex(keyIndex)) { - if (keyState.getKeyIndex() == NOT_A_KEY) { + if (oldKey == null) { keyState.onMoveToNewKey(keyIndex, x, y); mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this); } else if (!isMinorMoveBounce(x, y, keyIndex)) { + if (mListener != null) + mListener.onRelease(oldKey.codes[0]); resetMultiTap(); keyState.onMoveToNewKey(keyIndex, x, y); mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this); } } else { - if (keyState.getKeyIndex() != NOT_A_KEY) { + if (oldKey != null) { + if (mListener != null) + mListener.onRelease(oldKey.codes[0]); keyState.onMoveToNewKey(keyIndex, x ,y); mHandler.cancelLongPressTimer(); } else if (!isMinorMoveBounce(x, y, keyIndex)) { @@ -411,7 +416,7 @@ public class PointerTracker { private void showKeyPreviewAndUpdateKey(int keyIndex) { updateKey(keyIndex); // The modifier key, such as shift key, should not be shown as preview when multi-touch is - // supported. On thge other hand, if multi-touch is not supported, the modifier key should + // supported. On the other hand, if multi-touch is not supported, the modifier key should // be shown as preview. if (mHasDistinctMultitouch && isModifier()) { mProxy.showPreview(NOT_A_KEY, this); diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java index f24c180d0..4c54dd3c5 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInput.java +++ b/java/src/com/android/inputmethod/voice/VoiceInput.java @@ -16,6 +16,7 @@ package com.android.inputmethod.voice; +import com.android.inputmethod.latin.EditingUtil; import com.android.inputmethod.latin.R; import android.content.ContentResolver; @@ -30,6 +31,7 @@ import android.speech.RecognitionListener; import android.speech.SpeechRecognizer; import android.speech.RecognizerIntent; import android.util.Log; +import android.view.inputmethod.InputConnection; import android.view.View; import android.view.View.OnClickListener; @@ -423,8 +425,14 @@ public class VoiceInput implements OnClickListener { mLogger.textModifiedByTypingDeletion(length); } - public void logTextModifiedByChooseSuggestion(int length) { - mLogger.textModifiedByChooseSuggestion(length); + public void logTextModifiedByChooseSuggestion(String suggestion, int index, + String wordSeparators, InputConnection ic) { + EditingUtil.Range range = new EditingUtil.Range(); + String wordToBeReplaced = EditingUtil.getWordAtCursor(ic, wordSeparators, range); + // If we enable phrase-based alternatives, only send up the first word + // in suggestion and wordToBeReplaced. + mLogger.textModifiedByChooseSuggestion(suggestion.length(), wordToBeReplaced.length(), + index, wordToBeReplaced, suggestion); } public void logKeyboardWarningDialogShown() { @@ -455,10 +463,6 @@ public class VoiceInput implements OnClickListener { mLogger.voiceInputDelivered(length); } - public void logNBestChoose(int index) { - mLogger.nBestChoose(index); - } - public void logInputEnded() { mLogger.inputEnded(); } diff --git a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/voice/VoiceInputLogger.java index 188d1376e..0d21133e0 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java +++ b/java/src/com/android/inputmethod/voice/VoiceInputLogger.java @@ -205,22 +205,20 @@ public class VoiceInputLogger { mContext.sendBroadcast(i); } - public void textModifiedByChooseSuggestion(int length) { + public void textModifiedByChooseSuggestion(int suggestionLength, int replacedPhraseLength, + int index, String before, String after) { setHasLoggingInfo(true); Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED); - i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length); i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE, - LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_CHOOSE_SUGGESTION); - mContext.sendBroadcast(i); - } - - public void nBestChoose(int index) { - setHasLoggingInfo(true); - Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.N_BEST_CHOOSE); + LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_CHOOSE_SUGGESTION); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, suggestionLength); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_REPLACED_LENGTH, replacedPhraseLength); i.putExtra(LoggingEvents.VoiceIme.EXTRA_N_BEST_CHOOSE_INDEX, index); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_BEFORE_N_BEST_CHOOSE, before); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_AFTER_N_BEST_CHOOSE, after); mContext.sendBroadcast(i); } - + public void inputEnded() { setHasLoggingInfo(true); mContext.sendBroadcast(newLoggingBroadcast(LoggingEvents.VoiceIme.INPUT_ENDED)); |