aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2014-01-26 23:19:57 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-01-26 23:19:57 -0800
commit3873ee735d721e7dd5075fd77b5bb4cd5661e0cb (patch)
tree5a9b4ea793e74cf0b533818760e786d695e4d3bf /java/src
parent3dfdd307ce478b0a2057ce33b47f1ca6a8d4989c (diff)
parent03283b636c0c35bfd4ff8fe6b30db27fad5cf824 (diff)
downloadlatinime-3873ee735d721e7dd5075fd77b5bb4cd5661e0cb.tar.gz
latinime-3873ee735d721e7dd5075fd77b5bb4cd5661e0cb.tar.xz
latinime-3873ee735d721e7dd5075fd77b5bb4cd5661e0cb.zip
am 03283b63: Follow up to Ic7d2cbb2c1b2deaa4e735484bdc7413c0b3b1939
* commit '03283b636c0c35bfd4ff8fe6b30db27fad5cf824': Follow up to Ic7d2cbb2c1b2deaa4e735484bdc7413c0b3b1939
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java49
1 files changed, 23 insertions, 26 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index b094100c6..bba9bd52c 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1466,10 +1466,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final SuggestedWords punctuationList =
mSettings.getCurrent().mSpacingAndPunctuations.mSuggestPuncList;
final SuggestedWords oldSuggestedWords = previousSuggestedWords == punctuationList
- ? SuggestedWords.EMPTY : previousSuggestedWords;
- if (TextUtils.isEmpty(typedWord)) {
- return oldSuggestedWords;
- }
+ ? SuggestedWords.EMPTY : previousSuggestedWords;
final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions =
SuggestedWords.getTypedWordAndPreviousSuggestions(typedWord, oldSuggestedWords);
return new SuggestedWords(typedWordAndPreviousSuggestions,
@@ -1483,27 +1480,27 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void showSuggestionStripWithTypedWord(final SuggestedWords suggestedWords,
final String typedWord) {
- if (suggestedWords.isEmpty()) {
- // No auto-correction is available, clear the cached values.
- AccessibilityUtils.getInstance().setAutoCorrection(null, null);
- clearSuggestionStrip();
- return;
- }
- final String autoCorrection;
- if (suggestedWords.mWillAutoCorrect) {
- autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
- } else {
- // We can't use suggestedWords.getWord(SuggestedWords.INDEX_OF_TYPED_WORD)
- // because it may differ from mWordComposer.mTypedWord.
- autoCorrection = typedWord;
- }
- mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
- setSuggestedWords(suggestedWords);
- setAutoCorrectionIndicator(suggestedWords.mWillAutoCorrect);
- setSuggestionStripShown(isSuggestionsStripVisible());
- // An auto-correction is available, cache it in accessibility code so
- // we can be speak it if the user touches a key that will insert it.
- AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
+ if (suggestedWords.isEmpty()) {
+ // No auto-correction is available, clear the cached values.
+ AccessibilityUtils.getInstance().setAutoCorrection(null, null);
+ clearSuggestionStrip();
+ return;
+ }
+ final String autoCorrection;
+ if (suggestedWords.mWillAutoCorrect) {
+ autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
+ } else {
+ // We can't use suggestedWords.getWord(SuggestedWords.INDEX_OF_TYPED_WORD)
+ // because it may differ from mWordComposer.mTypedWord.
+ autoCorrection = typedWord;
+ }
+ mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
+ setSuggestedWords(suggestedWords);
+ setAutoCorrectionIndicator(suggestedWords.mWillAutoCorrect);
+ setSuggestionStripShown(isSuggestionsStripVisible());
+ // An auto-correction is available, cache it in accessibility code so
+ // we can be speak it if the user touches a key that will insert it.
+ AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
}
// TODO[IL]: Define a clean interface for this
@@ -1513,7 +1510,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
showSuggestionStripWithTypedWord(suggestedWords,
- suggestedWords.getWord(SuggestedWords.INDEX_OF_TYPED_WORD));
+ suggestedWords.getWord(SuggestedWords.INDEX_OF_TYPED_WORD));
}
// Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener}