diff options
author | 2013-12-19 17:43:22 +0900 | |
---|---|---|
committer | 2013-12-19 18:20:41 +0900 | |
commit | d85e49bf8cd9d8b850cb9f1ca0257e826b74642a (patch) | |
tree | 03c7315c1f1e62a05e9846a3911406bbe78b317d /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 40b42b7d8459d238f035fa7ea3c7be96ff01610f (diff) | |
download | latinime-d85e49bf8cd9d8b850cb9f1ca0257e826b74642a.tar.gz latinime-d85e49bf8cd9d8b850cb9f1ca0257e826b74642a.tar.xz latinime-d85e49bf8cd9d8b850cb9f1ca0257e826b74642a.zip |
[IL7] Move performRecapitalization to InputLogic
Bug: 8636060
Change-Id: I5bf2b1fa2f9338fe28151e66eac1ceda6dbd4a7f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e8af53a06..035cec453 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1799,53 +1799,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } - // TODO[IL]: Move this to InputLogic - public void performRecapitalization() { - if (mInputLogic.mLastSelectionStart == mInputLogic.mLastSelectionEnd) { - return; // No selection - } - // If we have a recapitalize in progress, use it; otherwise, create a new one. - if (!mInputLogic.mRecapitalizeStatus.isActive() - || !mInputLogic.mRecapitalizeStatus.isSetAt(mInputLogic.mLastSelectionStart, - mInputLogic.mLastSelectionEnd)) { - final CharSequence selectedText = - mInputLogic.mConnection.getSelectedText(0 /* flags, 0 for no styles */); - if (TextUtils.isEmpty(selectedText)) return; // Race condition with the input connection - final SettingsValues currentSettings = mSettings.getCurrent(); - mInputLogic.mRecapitalizeStatus.initialize(mInputLogic.mLastSelectionStart, - mInputLogic.mLastSelectionEnd, - selectedText.toString(), currentSettings.mLocale, - currentSettings.mWordSeparators); - // We trim leading and trailing whitespace. - mInputLogic.mRecapitalizeStatus.trim(); - // Trimming the object may have changed the length of the string, and we need to - // reposition the selection handles accordingly. As this result in an IPC call, - // only do it if it's actually necessary, in other words if the recapitalize status - // is not set at the same place as before. - if (!mInputLogic.mRecapitalizeStatus.isSetAt(mInputLogic.mLastSelectionStart, - mInputLogic.mLastSelectionEnd)) { - mInputLogic.mLastSelectionStart = - mInputLogic.mRecapitalizeStatus.getNewCursorStart(); - mInputLogic.mLastSelectionEnd = mInputLogic.mRecapitalizeStatus.getNewCursorEnd(); - } - } - mInputLogic.mConnection.finishComposingText(); - mInputLogic.mRecapitalizeStatus.rotate(); - final int numCharsDeleted = - mInputLogic.mLastSelectionEnd - mInputLogic.mLastSelectionStart; - mInputLogic.mConnection.setSelection(mInputLogic.mLastSelectionEnd, - mInputLogic.mLastSelectionEnd); - mInputLogic.mConnection.deleteSurroundingText(numCharsDeleted, 0); - mInputLogic.mConnection.commitText( - mInputLogic.mRecapitalizeStatus.getRecapitalizedString(), 0); - mInputLogic.mLastSelectionStart = mInputLogic.mRecapitalizeStatus.getNewCursorStart(); - mInputLogic.mLastSelectionEnd = mInputLogic.mRecapitalizeStatus.getNewCursorEnd(); - mInputLogic.mConnection.setSelection(mInputLogic.mLastSelectionStart, - mInputLogic.mLastSelectionEnd); - // Match the keyboard to the new state. - mKeyboardSwitcher.updateShiftState(); - } - // TODO[IL]: Rename this to avoid using handle* private void handleClose() { // TODO: Verify that words are logged properly when IME is closed. |