aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorAdrian Velicu <adrianv@google.com>2014-09-22 06:25:46 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-22 06:25:46 +0000
commitc096f715feb53571845d5aefc6bef840274ded89 (patch)
tree8adbc6203b5ad89a994af2b6bab2b67a735115b2 /java/src/com/android/inputmethod/latin/LatinIME.java
parent42852d3b6e9ef5008f1e52d0980c21e94ff87814 (diff)
parentb12c174c2f04461e5c5e0d2e148742ef0bfc5594 (diff)
downloadlatinime-c096f715feb53571845d5aefc6bef840274ded89.tar.gz
latinime-c096f715feb53571845d5aefc6bef840274ded89.tar.xz
latinime-c096f715feb53571845d5aefc6bef840274ded89.zip
am b12c174c: Merge "Hiding SuggestedWords.EMPTY and refactoring code that compares SuggestedWords instances directly to it to use isEmpty instead"
* commit 'b12c174c2f04461e5c5e0d2e148742ef0bfc5594': Hiding SuggestedWords.EMPTY and refactoring code that compares SuggestedWords instances directly to it to use isEmpty instead
Diffstat (limited to '')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 69fe6de9a..0a6a10dee 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1491,7 +1491,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final boolean isEmptyApplicationSpecifiedCompletions =
currentSettingsValues.isApplicationSpecifiedCompletionsOn()
&& suggestedWords.isEmpty();
- final boolean noSuggestionsFromDictionaries = (SuggestedWords.EMPTY == suggestedWords)
+ final boolean noSuggestionsFromDictionaries = suggestedWords.isEmpty()
|| suggestedWords.isPunctuationSuggestions()
|| isEmptyApplicationSpecifiedCompletions;
final boolean isBeginningOfSentencePrediction = (suggestedWords.mInputStyle
@@ -1518,7 +1518,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final OnGetSuggestedWordsCallback callback) {
final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
if (keyboard == null) {
- callback.onGetSuggestedWords(SuggestedWords.EMPTY);
+ callback.onGetSuggestedWords(SuggestedWords.getEmptyInstance());
return;
}
mInputLogic.getSuggestedWords(mSettings.getCurrent(), keyboard.getProximityInfo(),
@@ -1526,10 +1526,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
@Override
- public void showSuggestionStrip(final SuggestedWords sourceSuggestedWords) {
- final SuggestedWords suggestedWords =
- sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords;
- if (SuggestedWords.EMPTY == suggestedWords) {
+ public void showSuggestionStrip(final SuggestedWords suggestedWords) {
+ if (suggestedWords.isEmpty()) {
setNeutralSuggestionStrip();
} else {
setSuggestedWords(suggestedWords);
@@ -1537,7 +1535,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Cache the auto-correction in accessibility code so we can speak it if the user
// touches a key that will insert it.
AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords,
- sourceSuggestedWords.mTypedWord);
+ suggestedWords.mTypedWord);
}
// Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener}
@@ -1572,7 +1570,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void setNeutralSuggestionStrip() {
final SettingsValues currentSettings = mSettings.getCurrent();
final SuggestedWords neutralSuggestions = currentSettings.mBigramPredictionEnabled
- ? SuggestedWords.EMPTY : currentSettings.mSpacingAndPunctuations.mSuggestPuncList;
+ ? SuggestedWords.getEmptyInstance()
+ : currentSettings.mSpacingAndPunctuations.mSuggestPuncList;
setSuggestedWords(neutralSuggestions);
}