diff options
author | Leon Scroggins <scroggo@google.com> | 2011-01-19 17:01:55 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2011-01-21 15:42:03 -0500 |
commit | d5188657dcde0f40a6954a00d569c0575bf6095a (patch) | |
tree | a9212df979cf5b5a8d4ed7d676a15bfc6fc113ca /core/java/android/text/method | |
parent | 276677f2ac821e5eb8a7f6a4204242ee47501d6e (diff) | |
download | frameworks_base-d5188657dcde0f40a6954a00d569c0575bf6095a.zip frameworks_base-d5188657dcde0f40a6954a00d569c0575bf6095a.tar.gz frameworks_base-d5188657dcde0f40a6954a00d569c0575bf6095a.tar.bz2 |
Do a better job of lining up text with page text.
Bug:3085564
Bug:3196224
Bug:3321608
Remove Touch.getMaxScrollX(), which is incorrect for my
purpose, and is not used anywhere else. Instead use the
layout to determine the maximum horizontal scroll of a
textfield.
Now that textareas use layers, scroll the layer's picture
in the UI thread for vertical movement. When passing a
click to webcore, also pass a message to scroll the actual
textarea so the click will be in the correct place.
Lastly, do not override bringPointIntoView, which allows
moving the insertion handler beyond the edge of a field to
scroll it. Instead, override requestRectangleOnScreen to
do nothing, since my actual goal is to prevent the TextView
from changing the scroll of the WebView, which is done by
webkit.
Requires a change to external/webkit.
Change-Id: Ib91907599b792287c373d3678cb04e0cb5e34471
Diffstat (limited to 'core/java/android/text/method')
-rw-r--r-- | core/java/android/text/method/Touch.java | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/core/java/android/text/method/Touch.java b/core/java/android/text/method/Touch.java index 78cbdcf..a528044 100644 --- a/core/java/android/text/method/Touch.java +++ b/core/java/android/text/method/Touch.java @@ -77,24 +77,6 @@ public class Touch { } /** - * @hide - * Returns the maximum scroll value in x. - */ - public static int getMaxScrollX(TextView widget, Layout layout, int y) { - int top = layout.getLineForVertical(y); - int bottom = layout.getLineForVertical(y + widget.getHeight() - - widget.getTotalPaddingTop() -widget.getTotalPaddingBottom()); - int left = Integer.MAX_VALUE; - int right = 0; - for (int i = top; i <= bottom; i++) { - left = (int) Math.min(left, layout.getLineLeft(i)); - right = (int) Math.max(right, layout.getLineRight(i)); - } - return right - left - widget.getWidth() - widget.getTotalPaddingLeft() - - widget.getTotalPaddingRight(); - } - - /** * Handles touch events for dragging. You may want to do other actions * like moving the cursor on touch as well. */ |