From 5b2c056a3f66c11e3d6f7ba3507dc0f81928bf3a Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Wed, 30 Sep 2009 10:17:13 -0700 Subject: [PATCH] Keep the scrollbar on during TOUCH_MOVE events even when there is no movement. Fix http://b/issue?id=2151115 --- core/java/android/webkit/WebView.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index da040324c621a..4bc1a0e37b232 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3871,11 +3871,25 @@ public class WebView extends AbsoluteLayout if (mSnapScrollMode == SNAP_X || mSnapScrollMode == SNAP_X_LOCK) { - scrollBy(deltaX, 0); + if (deltaX == 0) { + // keep the scrollbar on the screen even there is no + // scroll + awakenScrollBars(ViewConfiguration + .getScrollDefaultDelay(), false); + } else { + scrollBy(deltaX, 0); + } mLastTouchX = x; } else if (mSnapScrollMode == SNAP_Y || mSnapScrollMode == SNAP_Y_LOCK) { - scrollBy(0, deltaY); + if (deltaY == 0) { + // keep the scrollbar on the screen even there is no + // scroll + awakenScrollBars(ViewConfiguration + .getScrollDefaultDelay(), false); + } else { + scrollBy(0, deltaY); + } mLastTouchY = y; } else { scrollBy(deltaX, deltaY); @@ -3900,6 +3914,9 @@ public class WebView extends AbsoluteLayout } if (done) { + // keep the scrollbar on the screen even there is no scroll + awakenScrollBars(ViewConfiguration.getScrollDefaultDelay(), + false); // return false to indicate that we can't pan out of the // view space return false;