From 30a72da42c479adb4cedff5d7a40846a3103ac9b Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 24 Dec 2013 21:55:09 +0900 Subject: [PATCH] [IL37] Small simplification Bug: 8636060 Change-Id: I08a6c04986a0bd86ce4c232893e804766ebeebb9 --- java/src/com/android/inputmethod/latin/LatinIME.java | 7 +++---- java/src/com/android/inputmethod/latin/SuggestedWords.java | 6 +----- .../latin/suggestions/SuggestionStripLayoutHelper.java | 6 +++--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 7d17b15b7..d8fb4f2be 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1147,7 +1147,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public boolean onEvaluateFullscreenMode() { - // Reread resource value here, because this method is called by framework anytime as needed. + // Reread resource value here, because this method is called by the framework as needed. final boolean isFullscreenModeAllowed = Settings.readUseFullscreenMode(getResources()); if (super.onEvaluateFullscreenMode() && isFullscreenModeAllowed) { // TODO: Remove this hack. Actually we should not really assume NO_EXTRACT_UI @@ -1628,9 +1628,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen autoCorrection = typedWord; } mInputLogic.mWordComposer.setAutoCorrection(autoCorrection); - final boolean isAutoCorrection = suggestedWords.willAutoCorrect(); - setSuggestedWords(suggestedWords, isAutoCorrection); - setAutoCorrectionIndicator(isAutoCorrection); + setSuggestedWords(suggestedWords, suggestedWords.mWillAutoCorrect); + 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. diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 97c89dd4e..f9de89c80 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -104,10 +104,6 @@ public final class SuggestedWords { return debugString; } - public boolean willAutoCorrect() { - return mWillAutoCorrect; - } - @Override public String toString() { // Pretty-print method to help debug @@ -150,7 +146,7 @@ public final class SuggestedWords { for (int index = 1; index < previousSize; index++) { final SuggestedWordInfo prevWordInfo = previousSuggestions.getInfo(index); final String prevWord = prevWordInfo.mWord; - // Filter out duplicate suggestion. + // Filter out duplicate suggestions. if (!alreadySeen.contains(prevWord)) { suggestionsList.add(prevWordInfo); alreadySeen.add(prevWord); diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 72281e62c..f836e61cb 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -208,7 +208,7 @@ final class SuggestionStripLayoutHelper { } final String word = suggestedWords.getWord(indexInSuggestedWords); final boolean isAutoCorrect = indexInSuggestedWords == 1 - && suggestedWords.willAutoCorrect(); + && suggestedWords.mWillAutoCorrect; final boolean isTypedWordValid = indexInSuggestedWords == 0 && suggestedWords.mTypedWordValid; if (!isAutoCorrect && !isTypedWordValid) { @@ -232,7 +232,7 @@ final class SuggestionStripLayoutHelper { final SuggestedWords suggestedWords) { final int indexToDisplayMostImportantSuggestion; final int indexToDisplaySecondMostImportantSuggestion; - if (suggestedWords.willAutoCorrect()) { + if (suggestedWords.mWillAutoCorrect) { indexToDisplayMostImportantSuggestion = SuggestedWords.INDEX_OF_AUTO_CORRECTION; indexToDisplaySecondMostImportantSuggestion = SuggestedWords.INDEX_OF_TYPED_WORD; } else { @@ -257,7 +257,7 @@ final class SuggestionStripLayoutHelper { final boolean isSuggested = (indexInSuggestedWords != SuggestedWords.INDEX_OF_TYPED_WORD); final int color; - if (positionInStrip == mCenterPositionInStrip && suggestedWords.willAutoCorrect()) { + if (positionInStrip == mCenterPositionInStrip && suggestedWords.mWillAutoCorrect) { color = mColorAutoCorrect; } else if (positionInStrip == mCenterPositionInStrip && suggestedWords.mTypedWordValid) { color = mColorValidTypedWord;