diff options
| author | Gilles Debunne <debunne@google.com> | 2010-12-08 17:43:58 -0800 |
|---|---|---|
| committer | Gilles Debunne <debunne@google.com> | 2010-12-10 11:31:59 -0800 |
| commit | cf9cf2f40efc4ccf3f73e6fdb07725d9c00c4f91 (patch) | |
| tree | 89a70a7fd0d4c3289df77b6e2422d0ce59409e81 /core/java/android/widget/TextView.java | |
| parent | 70e81ba9abbac2f9e5add30fb749c4bd85441d4c (diff) | |
New API in InputConnection to signal IME's text correction.
Scafolding so that the IME team can start working on this feature.
The animation part in the TextView is missing.
Change-Id: I8225538564370fba1500e3539742a8ab79bdd199
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 3cf945d160a7..e4d26f0f1909 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -114,6 +114,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.animation.AnimationUtils; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.CompletionInfo; +import android.view.inputmethod.CorrectionInfo; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.ExtractedText; import android.view.inputmethod.ExtractedTextRequest; @@ -5057,6 +5058,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void onCommitCompletion(CompletionInfo text) { } + /** + * Called by the framework in response to a text auto-correction (such as fixing a typo using a + * a dictionnary) from the current input method, provided by it calling + * {@link InputConnection#commitCorrection} InputConnection.commitCorrection()}. The default + * implementation flashes the background of the corrected word to provide feedback to the user. + * + * @param info The auto correct info about the text that was corrected. + */ + public void onCommitCorrection(CorrectionInfo info) { + // TODO + } + public void beginBatchEdit() { mInBatchEditControllers = true; final InputMethodState ims = mInputMethodState; @@ -6572,8 +6585,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * Not private so it can be called from an inner class without going * through a thunk. */ - void handleTextChanged(CharSequence buffer, int start, - int before, int after) { + void handleTextChanged(CharSequence buffer, int start, int before, int after) { final InputMethodState ims = mInputMethodState; if (ims == null || ims.mBatchEditNesting == 0) { updateAfterEdit(); @@ -6603,8 +6615,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * Not private so it can be called from an inner class without going * through a thunk. */ - void spanChange(Spanned buf, Object what, int oldStart, int newStart, - int oldEnd, int newEnd) { + void spanChange(Spanned buf, Object what, int oldStart, int newStart, int oldEnd, int newEnd) { // XXX Make the start and end move together if this ends up // spending too much time invalidating. |
