Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a622c56 authored by John Reck's avatar John Reck Committed by Android Git Automerger
Browse files

am a0c6bf5a: Merge "Call onScrollChanged when scrolling layers" into ics-mr1

* commit 'a0c6bf5a':
  Call onScrollChanged when scrolling layers
parents 716747f7 a0c6bf5a
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -3097,10 +3097,7 @@ public class WebView extends AbsoluteLayout
        // Special-case layer scrolling so that we do not trigger normal scroll
        // updating.
        if (mTouchMode == TOUCH_DRAG_LAYER_MODE) {
            nativeScrollLayer(mScrollingLayer, scrollX, scrollY);
            mScrollingLayerRect.left = scrollX;
            mScrollingLayerRect.top = scrollY;
            invalidate();
            scrollLayerTo(scrollX, scrollY);
            return;
        }
        mInOverScrollMode = false;
@@ -3603,9 +3600,7 @@ public class WebView extends AbsoluteLayout
                    mScrollY = y;
                } else {
                    // Update the layer position instead of WebView.
                    nativeScrollLayer(mScrollingLayer, x, y);
                    mScrollingLayerRect.left = x;
                    mScrollingLayerRect.top = y;
                    scrollLayerTo(x, y);
                }
                abortAnimation();
                nativeSetIsScrolling(false);
@@ -3624,6 +3619,17 @@ public class WebView extends AbsoluteLayout
        }
    }

    private void scrollLayerTo(int x, int y) {
        if (x == mScrollingLayerRect.left && y == mScrollingLayerRect.top) {
            return;
        }
        nativeScrollLayer(mScrollingLayer, x, y);
        mScrollingLayerRect.left = x;
        mScrollingLayerRect.top = y;
        onScrollChanged(mScrollX, mScrollY, mScrollX, mScrollY);
        invalidate();
    }

    private static int computeDuration(int dx, int dy) {
        int distance = Math.max(Math.abs(dx), Math.abs(dy));
        int duration = distance * 1000 / STD_SPEED;
@@ -8309,12 +8315,8 @@ public class WebView extends AbsoluteLayout
                    if (mScrollingLayer == 0) {
                        pinScrollBy(mAutoScrollX, mAutoScrollY, true, 0);
                    } else {
                        mScrollingLayerRect.left += mAutoScrollX;
                        mScrollingLayerRect.top += mAutoScrollY;
                        nativeScrollLayer(mScrollingLayer,
                                mScrollingLayerRect.left,
                                mScrollingLayerRect.top);
                        invalidate();
                        scrollLayerTo(mScrollingLayerRect.left + mAutoScrollX,
                                mScrollingLayerRect.top + mAutoScrollY);
                    }
                    sendEmptyMessageDelayed(
                            SCROLL_SELECT_TEXT, SELECT_SCROLL_INTERVAL);