OSDN Git Service

Bug 5255124: Move cursor to the end of a word after correction popup alternates selection
authorGilles Debunne <debunne@google.com>
Fri, 9 Sep 2011 21:49:26 +0000 (14:49 -0700)
committerGilles Debunne <debunne@google.com>
Fri, 9 Sep 2011 22:02:10 +0000 (15:02 -0700)
Change-Id: Idd3edc72edf864f256df173bcf643163192ecbde

core/java/android/widget/TextView.java

index ebe22cc..0ec357f 100644 (file)
@@ -9901,6 +9901,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                                     suggestionSpansFlags[i]);
                         }
                     }
+                    
+                    // Move cursor at the end of the replacement word
+                    Selection.setSelection(editable, spanEnd + lengthDifference);
                 }
             }
             hide();