aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-19 01:42:57 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-19 01:42:57 -0800
commit90f56f72fdde721320cca378c8d64dcae9fe3adb (patch)
tree03c7315c1f1e62a05e9846a3911406bbe78b317d /java/src/com/android/inputmethod/latin/LatinIME.java
parent278a00d1b8715b745b6e8657354477ff5288bf7c (diff)
parentd85e49bf8cd9d8b850cb9f1ca0257e826b74642a (diff)
downloadlatinime-90f56f72fdde721320cca378c8d64dcae9fe3adb.tar.gz
latinime-90f56f72fdde721320cca378c8d64dcae9fe3adb.tar.xz
latinime-90f56f72fdde721320cca378c8d64dcae9fe3adb.zip
am d85e49bf: [IL7] Move performRecapitalization to InputLogic
* commit 'd85e49bf8cd9d8b850cb9f1ca0257e826b74642a': [IL7] Move performRecapitalization to InputLogic
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java47
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.