diff options
author | 2014-06-04 12:24:37 +0000 | |
---|---|---|
committer | 2014-06-04 12:24:37 +0000 | |
commit | a0af828eac3c21552e3d957e676605e49c6096c7 (patch) | |
tree | 812e2517fbc04c2a23752a1544563065b5f8bf37 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | 04d9d50a6095e4fcd9b5f69e603c3ea70f60fee3 (diff) | |
parent | 4c911427712382c3f020f9c0022f5c1ea29cdede (diff) | |
download | latinime-a0af828eac3c21552e3d957e676605e49c6096c7.tar.gz latinime-a0af828eac3c21552e3d957e676605e49c6096c7.tar.xz latinime-a0af828eac3c21552e3d957e676605e49c6096c7.zip |
am 4c911427: Merge "Don\'t recapitalize just at the start of input"
* commit '4c911427712382c3f020f9c0022f5c1ea29cdede':
Don't recapitalize just at the start of input
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 12 |
1 files changed, 5 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 55cc135d3..dbbe1a0c5 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.stop(); // In case a recapitalization is started + mRecapitalizeStatus.disable(); // Do not perform recapitalize until the cursor is moved once mCurrentlyPressedHardwareKeys.clear(); mSuggestedWords = SuggestedWords.EMPTY; // In some cases (namely, after rotation of the device) editorInfo.initialSelStart is lying @@ -345,6 +345,8 @@ public final class InputLogic { newSelStart, newSelEnd, false /* shouldFinishComposition */); } + // The cursor has been moved : we now accept to perform recapitalization + mRecapitalizeStatus.enable(); // We moved the cursor. If we are touching a word, we need to resume suggestion. mLatinIME.mHandler.postResumeSuggestions(); // Stop the last recapitalization, if started. @@ -369,10 +371,6 @@ public final class InputLogic { final int keyboardShiftMode, // TODO: remove this argument final LatinIME.UIHandler handler) { - // TODO: rework the following to not squash the keycode and the code point into the same - // var because it's confusing. Instead the switch() should handle this in a readable manner. - final int code = - Event.NOT_A_CODE_POINT == event.mCodePoint ? event.mKeyCode : event.mCodePoint; final InputTransaction inputTransaction = new InputTransaction(settingsValues, event, SystemClock.uptimeMillis(), mSpaceState, getActualCapsMode(settingsValues, keyboardShiftMode)); @@ -1138,8 +1136,8 @@ public final class InputLogic { * @param settingsValues The current settings values. */ private void performRecapitalization(final SettingsValues settingsValues) { - if (!mConnection.hasSelection()) { - return; // No selection + if (!mConnection.hasSelection() || !mRecapitalizeStatus.mIsEnabled()) { + return; // No selection or recapitalize is disabled for now } final int selectionStart = mConnection.getExpectedSelectionStart(); final int selectionEnd = mConnection.getExpectedSelectionEnd(); |