Commit 7de8697a authored by mkosiba@chromium.org's avatar mkosiba@chromium.org

[android_webview] Set 'fling active' flag only from computeScroll.

This prevents us getting stuck in smoothness mode if the embedding application
inhibits the View.computeScroll callback.

BUG=339245

Review URL: https://codereview.chromium.org/149963002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247930 0039d316-1c4b-4281-b951-d872f2087c98
parent 0178cf31
...@@ -26,7 +26,11 @@ public class AwScrollOffsetManager { ...@@ -26,7 +26,11 @@ public class AwScrollOffsetManager {
// Time for the longest scroll animation. // Time for the longest scroll animation.
private static final int MAX_SCROLL_ANIMATION_DURATION_MILLISEC = 750; private static final int MAX_SCROLL_ANIMATION_DURATION_MILLISEC = 750;
// The unit of all the values in this delegate are physical pixels. /**
* The interface that all users of AwScrollOffsetManager should implement.
*
* The unit of all the values in this delegate are physical pixels.
*/
public interface Delegate { public interface Delegate {
// Call View#overScrollBy on the containerView. // Call View#overScrollBy on the containerView.
void overScrollContainerViewBy(int deltaX, int deltaY, int scrollX, int scrollY, void overScrollContainerViewBy(int deltaX, int deltaY, int scrollX, int scrollY,
...@@ -279,15 +283,13 @@ public class AwScrollOffsetManager { ...@@ -279,15 +283,13 @@ public class AwScrollOffsetManager {
mScroller.fling(scrollX, scrollY, velocityX, velocityY, mScroller.fling(scrollX, scrollY, velocityX, velocityY,
0, scrollRangeX, 0, scrollRangeY); 0, scrollRangeX, 0, scrollRangeY);
mFlinging = true;
mDelegate.invalidate(); mDelegate.invalidate();
} }
// Called immediately before the draw to update the scroll offset. // Called immediately before the draw to update the scroll offset.
public void computeScrollAndAbsorbGlow(OverScrollGlow overScrollGlow) { public void computeScrollAndAbsorbGlow(OverScrollGlow overScrollGlow) {
final boolean stillAnimating = mScroller.computeScrollOffset(); mFlinging = mScroller.computeScrollOffset();
if (!stillAnimating) { if (!mFlinging) {
mFlinging = false;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment