diff options
author | 2014-02-18 17:07:46 +0900 | |
---|---|---|
committer | 2014-02-18 17:07:46 +0900 | |
commit | 63be066544f19928d6a29c58c028cce7c95fa457 (patch) | |
tree | 8281b076c407bfd70edc5295e7358003c3a7eab6 /java | |
parent | db21fad18f70eb4abaf60a8c0ae7f285682acf20 (diff) | |
download | latinime-63be066544f19928d6a29c58c028cce7c95fa457.tar.gz latinime-63be066544f19928d6a29c58c028cce7c95fa457.tar.xz latinime-63be066544f19928d6a29c58c028cce7c95fa457.zip |
Cleanup.
Less code, less chance of stuff escaping, and a bit of a clarification.
Yay.
Change-Id: I3193fd8ad7ac28195260cbc231c4e498a63a460c
Diffstat (limited to 'java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 8 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 13 |
2 files changed, 3 insertions, 18 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index d922ef6eb..4bee987cf 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1310,12 +1310,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Nothing to do so far. } - // TODO: remove this, read this directly from mInputLogic or something in the tests - @UsedForTesting - public boolean isShowingPunctuationList() { - return mInputLogic.isShowingPunctuationList(mSettings.getCurrent()); - } - // TODO[IL]: Define a clear interface for this public boolean isSuggestionStripVisible() { final SettingsValues currentSettings = mSettings.getCurrent(); @@ -1692,7 +1686,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // TODO: can this be removed somehow without breaking the tests? @UsedForTesting - /* package for test */ SuggestedWords getSuggestedWords() { + /* package for test */ SuggestedWords getSuggestedWordsForTest() { // You may not use this method for anything else than debug return DEBUG ? mInputLogic.mSuggestedWords : null; } diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 9bf9d1f45..3fc2cf8fd 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -198,7 +198,7 @@ public final class InputLogic { final SuggestedWords suggestedWords = mSuggestedWords; final String suggestion = suggestionInfo.mWord; // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput - if (suggestion.length() == 1 && isShowingPunctuationList(settingsValues)) { + if (suggestion.length() == 1 && suggestedWords.isPunctuationSuggestions()) { // Word separators are suggested before the user inputs something. // So, LatinImeLogger logs "" as a user's input. LatinImeLogger.logOnManualSuggestion("", suggestion, index, suggestedWords); @@ -821,7 +821,7 @@ public final class InputLogic { if (maybeDoubleSpacePeriod(settingsValues, handler)) { keyboardSwitcher.updateShiftState(); mSpaceState = SpaceState.DOUBLE; - } else if (!isShowingPunctuationList(settingsValues)) { + } else if (!mSuggestedWords.isPunctuationSuggestions()) { mSpaceState = SpaceState.WEAK; } } @@ -1456,15 +1456,6 @@ public final class InputLogic { } /** - * Find out if the punctuation list is shown in the suggestion strip. - * @return whether the current suggestions are the punctuation list. - */ - // TODO: make this private. It's used through LatinIME for tests. - public boolean isShowingPunctuationList(final SettingsValues settingsValues) { - return settingsValues.mSpacingAndPunctuations.mSuggestPuncList == mSuggestedWords; - } - - /** * Factor in auto-caps and manual caps and compute the current caps mode. * @param settingsValues the current settings values. * @param keyboardShiftMode the current shift mode of the keyboard. See |