Merge "Add support for sending touch events in DRT."

This commit is contained in:
Ben Murdoch
2010-02-03 09:15:34 -08:00
committed by Android (Google) Code Review
6 changed files with 294 additions and 8 deletions

View File

@@ -342,6 +342,7 @@ public class WebView extends AbsoluteLayout
* choice. Maybe make this in the buildspec later.
*/
private static final int TOUCH_SENT_INTERVAL = 50;
private int mCurrentTouchInterval = TOUCH_SENT_INTERVAL;
/**
* Helper class to get velocity for fling
@@ -4343,7 +4344,7 @@ public class WebView extends AbsoluteLayout
// pass the touch events from UI thread to WebCore thread
if (mForwardTouchEvents && (action != MotionEvent.ACTION_MOVE
|| eventTime - mLastSentTouchTime > TOUCH_SENT_INTERVAL)) {
|| eventTime - mLastSentTouchTime > mCurrentTouchInterval)) {
WebViewCore.TouchEventData ted = new WebViewCore.TouchEventData();
ted.mAction = action;
ted.mX = viewToContentX((int) x + mScrollX);
@@ -6633,6 +6634,16 @@ public class WebView extends AbsoluteLayout
mWebViewCore.drawContentPicture(canvas, 0, false, false);
}
/**
* Set the time to wait between passing touches to WebCore. See also the
* TOUCH_SENT_INTERVAL member for further discussion.
*
* @hide This is only used by the DRT test application.
*/
public void setTouchInterval(int interval) {
mCurrentTouchInterval = interval;
}
/**
* Update our cache with updatedText.
* @param updatedText The new text to put in our cache.