am b2ade4a7: Merge "Make sure when WebView modified mScrollX/Y directly, onScrollChanged() is called so that the View system can do what it needs to adjust." into froyo

Merge commit 'b2ade4a7e60bed95a25714fbfaeb1a8d8f734dc0' into froyo-plus-aosp

* commit 'b2ade4a7e60bed95a25714fbfaeb1a8d8f734dc0':
  Make sure when WebView modified mScrollX/Y directly,
This commit is contained in:
Grace Kloba
2010-04-02 16:46:39 -07:00
committed by Android Git Automerger

View File

@ -2066,7 +2066,7 @@ public class WebView extends AbsoluteLayout
mScrollX = pinLocX(mScrollX);
mScrollY = pinLocY(mScrollY);
if (oldX != mScrollX || oldY != mScrollY) {
sendOurVisibleRect();
onScrollChanged(mScrollX, mScrollY, oldX, oldY);
}
if (!mScroller.isFinished()) {
// We are in the middle of a scroll. Repin the final scroll
@ -2130,9 +2130,12 @@ public class WebView extends AbsoluteLayout
mScrollX = pinLocX(Math.round(sx));
mScrollY = pinLocY(Math.round(sy));
if (oldX != mScrollX || oldY != mScrollY) {
onScrollChanged(mScrollX, mScrollY, oldX, oldY);
}
// update webkit
sendViewSizeZoom();
sendOurVisibleRect();
}
}
}
@ -2634,9 +2637,7 @@ public class WebView extends AbsoluteLayout
mScrollY = mScroller.getCurrY();
postInvalidate(); // So we draw again
if (oldX != mScrollX || oldY != mScrollY) {
// As onScrollChanged() is not called, sendOurVisibleRect()
// needs to be called explicitly.
sendOurVisibleRect();
onScrollChanged(mScrollX, mScrollY, oldX, oldY);
}
} else {
super.computeScroll();
@ -3347,10 +3348,12 @@ public class WebView extends AbsoluteLayout
mUserScroll = false;
mWebViewCore.sendMessage(EventHub.SYNC_SCROLL, oldScrollX,
oldScrollY);
}
onScrollChanged(mScrollX, mScrollY, oldScrollX, oldScrollY);
} else {
sendOurVisibleRect();
}
}
}
WebViewCore.CursorData cursorData() {
WebViewCore.CursorData result = new WebViewCore.CursorData();