Allow scrolls to continue when getting a new content size.

In recordNewContentSize, rather than aborting any scrolls in progress,
find the final coordinates of the scroll and pin them to the new size,
and let the scroll continue.

Fixes http://b/issue?id=2141960

Change-Id: I7bfa444b52e70a0ca817221f379df77efc3496b7
This commit is contained in:
Leon Scroggins
2009-09-29 11:11:45 -04:00
parent fff0b4a6c2
commit d84e7d53d3

View File

@ -1917,12 +1917,15 @@ public class WebView extends AbsoluteLayout
int oldY = mScrollY;
mScrollX = pinLocX(mScrollX);
mScrollY = pinLocY(mScrollY);
// android.util.Log.d("skia", "recordNewContentSize -
// abortAnimation");
abortAnimation(); // just in case
if (oldX != mScrollX || oldY != mScrollY) {
sendOurVisibleRect();
}
if (!mScroller.isFinished()) {
// We are in the middle of a scroll. Repin the final scroll
// position.
mScroller.setFinalX(pinLocX(mScroller.getFinalX()));
mScroller.setFinalY(pinLocY(mScroller.getFinalY()));
}
}
}
contentSizeChanged(updateLayout);