diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-11-26 17:32:17 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-11-26 17:52:06 -0800 |
commit | 02c6fca90ad28c391ad6f0f70b24996acb206d74 (patch) | |
tree | 9b254b192cffdef02aab4dea5d0e038067ff63f1 | |
parent | f7f1c6a78ec12ca6618313f010b30d9dffee9b49 (diff) | |
download | frameworks_base-02c6fca90ad28c391ad6f0f70b24996acb206d74.zip frameworks_base-02c6fca90ad28c391ad6f0f70b24996acb206d74.tar.gz frameworks_base-02c6fca90ad28c391ad6f0f70b24996acb206d74.tar.bz2 |
Cannot move edit text cursor to first position using character granularity.
Navigating over text backwards by character does not allow the cursor to get
at the beginning of the text and it stops one position before the start. Now
the cursor can get to index zero which is before the first character.
bug:7307336
Change-Id: I109b579835cc080907b20b01e0cf07811e962c6c
-rw-r--r-- | core/java/android/view/View.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ff44475..0cc8b62 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -7010,10 +7010,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, int current = getAccessibilityCursorPosition(); if (current == ACCESSIBILITY_CURSOR_POSITION_UNDEFINED) { current = text.length(); + setAccessibilityCursorPosition(current); } else if (granularity == AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER) { // When traversing by character we always put the cursor after the character // to ease edit and have to compensate before asking the for previous segment. current--; + setAccessibilityCursorPosition(current); } final int[] range = iterator.preceding(current); if (range == null) { |