summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorMady Mellor <madym@google.com>2015-06-18 18:06:12 -0700
committerMady Mellor <madym@google.com>2015-06-18 18:06:12 -0700
commit8fc9bed98579ed2696a89cd43472ee414e74be6b (patch)
tree334213ab89660e0f9635af6ed2bc455a9480a7f9 /core/java/android
parentb0a8d2c4aecb6dfe5f7a95f56ca739fbea6301e5 (diff)
Text selection: When user reaches midpoint jump to end of word
Adjusts the point at which the handles jump to the end of the word. Previously it was 1 or 2 characters depending on word length, now it will use the midpoint of the word. Bug: 21131483 Change-Id: I0d3c1bf4672ae27781318cf2563051cc66bb9f98
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/Editor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 9ca59f1ab055..ab412f15a378 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -4123,7 +4123,7 @@ public class Editor {
if (!mInWord || currLine < mPrevLine) {
// We're not in a word, or we're on a different line so we'll expand by
// word. First ensure the user has at least entered the next word.
- int offsetToWord = Math.min((end - start) / 2, 2);
+ int offsetToWord = (end - start) / 2;
if (offset <= end - offsetToWord || currLine < mPrevLine) {
offset = start;
} else {
@@ -4262,7 +4262,7 @@ public class Editor {
if (!mInWord || currLine > mPrevLine) {
// We're not in a word, or we're on a different line so we'll expand by
// word. First ensure the user has at least entered the next word.
- int midPoint = Math.min((end - start) / 2, 2);
+ int midPoint = (end - start) / 2;
if (offset >= start + midPoint || currLine > mPrevLine) {
offset = end;
} else {