diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r-- | java/src/com/android/inputmethod/latin/EditingUtils.java | 17 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 6 |
2 files changed, 10 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/EditingUtils.java b/java/src/com/android/inputmethod/latin/EditingUtils.java index 1e8ad1840..b3f613bae 100644 --- a/java/src/com/android/inputmethod/latin/EditingUtils.java +++ b/java/src/com/android/inputmethod/latin/EditingUtils.java @@ -1,12 +1,12 @@ /* * Copyright (C) 2009 The Android Open Source Project - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -16,8 +16,6 @@ package com.android.inputmethod.latin; -import com.android.inputmethod.compat.InputConnectionCompatUtils; - import android.text.TextUtils; import android.view.inputmethod.ExtractedText; import android.view.inputmethod.ExtractedTextRequest; @@ -246,7 +244,7 @@ public class EditingUtils { if (selStart == selEnd) { // There is just a cursor, so get the word at the cursor // getWordRangeAtCursor returns null if the connection is null - EditingUtils.Range range = getWordRangeAtCursor(ic, wordSeparators); + final EditingUtils.Range range = getWordRangeAtCursor(ic, wordSeparators); if (range != null && !TextUtils.isEmpty(range.mWord)) { return new SelectedWord(selStart - range.mCharsBefore, selEnd + range.mCharsAfter, range.mWord); @@ -254,20 +252,19 @@ public class EditingUtils { } else { if (null == ic) return null; // Is the previous character empty or a word separator? If not, return null. - CharSequence charsBefore = ic.getTextBeforeCursor(1, 0); + final CharSequence charsBefore = ic.getTextBeforeCursor(1, 0); if (!isWordBoundary(charsBefore, wordSeparators)) { return null; } // Is the next character empty or a word separator? If not, return null. - CharSequence charsAfter = ic.getTextAfterCursor(1, 0); + final CharSequence charsAfter = ic.getTextAfterCursor(1, 0); if (!isWordBoundary(charsAfter, wordSeparators)) { return null; } // Extract the selection alone - CharSequence touching = InputConnectionCompatUtils.getSelectedText( - ic, selStart, selEnd); + final CharSequence touching = ic.getSelectedText(0); if (TextUtils.isEmpty(touching)) return null; // Is any part of the selection a separator? If so, return null. final int length = touching.length(); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index f5909a692..363494b7d 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -46,6 +46,7 @@ import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.inputmethod.CompletionInfo; +import android.view.inputmethod.CorrectionInfo; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.ExtractedText; import android.view.inputmethod.InputConnection; @@ -54,7 +55,6 @@ import com.android.inputmethod.accessibility.AccessibilityUtils; import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy; import com.android.inputmethod.compat.CompatUtils; import com.android.inputmethod.compat.EditorInfoCompatUtils; -import com.android.inputmethod.compat.InputConnectionCompatUtils; import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; import com.android.inputmethod.compat.InputMethodServiceCompatWrapper; import com.android.inputmethod.compat.InputMethodSubtypeCompatWrapper; @@ -1787,8 +1787,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (!typedWord.equals(autoCorrection) && null != ic) { // This will make the correction flash for a short while as a visual clue // to the user that auto-correction happened. - InputConnectionCompatUtils.commitCorrection(ic, - mLastSelectionEnd - typedWord.length(), typedWord, autoCorrection); + ic.commitCorrection(new CorrectionInfo(mLastSelectionEnd - typedWord.length(), + typedWord, autoCorrection)); } } } |