Fix: TextView cannot be scrolled.

scrollTo in Touch#onTouchEvent was wrongly removed in
I1b29a65be3d321ac while moving mouse text selection logic
added in Iab264bb954b.

Bug: 26409193

Change-Id: Ibb0b13be9492d658785f2ac72be383e634ad96f8
This commit is contained in:
Keisuke Kuroyanagi
2016-01-06 19:23:43 +09:00
parent 1ee3e370f9
commit cb4a2bb5de

View File

@@ -150,6 +150,7 @@ public class Touch {
ds[0].mX = event.getX();
ds[0].mY = event.getY();
int nx = widget.getScrollX() + (int) dx;
int ny = widget.getScrollY() + (int) dy;
int padding = widget.getTotalPaddingTop() + widget.getTotalPaddingBottom();
@@ -161,6 +162,8 @@ public class Touch {
int oldX = widget.getScrollX();
int oldY = widget.getScrollY();
scrollTo(widget, layout, nx, ny);
// If we actually scrolled, then cancel the up action.
if (oldX != widget.getScrollX() || oldY != widget.getScrollY()) {
widget.cancelLongPress();