diff options
author | 2014-06-04 15:19:10 +0900 | |
---|---|---|
committer | 2014-06-04 16:29:29 +0900 | |
commit | 4a1113b6b065931322df8bba375864274a898acf (patch) | |
tree | bd540e83ed2e665427617298595c0ddfb26a0cd7 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | 2660b70f806b5b8eb4aca8abf1fb734a21773d29 (diff) | |
download | latinime-4a1113b6b065931322df8bba375864274a898acf.tar.gz latinime-4a1113b6b065931322df8bba375864274a898acf.tar.xz latinime-4a1113b6b065931322df8bba375864274a898acf.zip |
Refactoring
Rename `initialize' to `start' and `deactivate' to `stop' for ease
of understanding. It's completely bizarre that you can "deactivate"
a recapitalization and that will just restart a new one the next time
you press shift. Start and stop are easier to understand.
Change-Id: I455175aebfcfe11198c6c61bf2c6b19efc3f82df
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index f36b42a40..55cc135d3 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -134,7 +134,7 @@ public final class InputLogic { resetComposingState(true /* alsoResetLastComposedWord */); mDeleteCount = 0; mSpaceState = SpaceState.NONE; - mRecapitalizeStatus.deactivate(); + mRecapitalizeStatus.stop(); // In case a recapitalization is started mCurrentlyPressedHardwareKeys.clear(); mSuggestedWords = SuggestedWords.EMPTY; // In some cases (namely, after rotation of the device) editorInfo.initialSelStart is lying @@ -347,8 +347,8 @@ public final class InputLogic { // We moved the cursor. If we are touching a word, we need to resume suggestion. mLatinIME.mHandler.postResumeSuggestions(); - // Reset the last recapitalization. - mRecapitalizeStatus.deactivate(); + // Stop the last recapitalization, if started. + mRecapitalizeStatus.stop(); return true; } @@ -1149,13 +1149,13 @@ public final class InputLogic { // to suck possibly multiple-megabyte data. return; } - // If we have a recapitalize in progress, use it; otherwise, create a new one. - if (!mRecapitalizeStatus.isActive() + // If we have a recapitalize in progress, use it; otherwise, start a new one. + if (!mRecapitalizeStatus.isStarted() || !mRecapitalizeStatus.isSetAt(selectionStart, selectionEnd)) { final CharSequence selectedText = mConnection.getSelectedText(0 /* flags, 0 for no styles */); if (TextUtils.isEmpty(selectedText)) return; // Race condition with the input connection - mRecapitalizeStatus.initialize(selectionStart, selectionEnd, selectedText.toString(), + mRecapitalizeStatus.start(selectionStart, selectionEnd, selectedText.toString(), settingsValues.mLocale, settingsValues.mSpacingAndPunctuations.mSortedWordSeparators); // We trim leading and trailing whitespace. @@ -1498,7 +1498,7 @@ public final class InputLogic { } public int getCurrentRecapitalizeState() { - if (!mRecapitalizeStatus.isActive() + if (!mRecapitalizeStatus.isStarted() || !mRecapitalizeStatus.isSetAt(mConnection.getExpectedSelectionStart(), mConnection.getExpectedSelectionEnd())) { // Not recapitalizing at the moment |