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

Commit d9e37dfa authored by Mindy Pereira's avatar Mindy Pereira Committed by Android (Google) Code Review
Browse files

Merge "Make webview edges behave the same way abslistview overscroll edges do."

parents 11a8af5e 3331f2be
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -168,18 +168,18 @@ public class OverScrollGlow {
        if (!mEdgeGlowTop.isFinished()) {
            final int restoreCount = canvas.save();

            canvas.translate(-width / 2 + scrollX, Math.min(0, scrollY));
            mEdgeGlowTop.setSize(width * 2, height);
            canvas.translate(scrollX, mHostView.getVisibleTitleHeight() + Math.min(0, scrollY));
            mEdgeGlowTop.setSize(width, height);
            invalidateForGlow |= mEdgeGlowTop.draw(canvas);
            canvas.restoreToCount(restoreCount);
        }
        if (!mEdgeGlowBottom.isFinished()) {
            final int restoreCount = canvas.save();

            canvas.translate(-width / 2 + scrollX,
                    Math.max(mHostView.computeMaxScrollY(), scrollY) + height);
            canvas.translate(-width + scrollX, Math.max(mHostView.computeMaxScrollY(), scrollY)
                    + height);
            canvas.rotate(180, width, 0);
            mEdgeGlowBottom.setSize(width * 2, height);
            mEdgeGlowBottom.setSize(width, height);
            invalidateForGlow |= mEdgeGlowBottom.draw(canvas);
            canvas.restoreToCount(restoreCount);
        }
@@ -187,8 +187,8 @@ public class OverScrollGlow {
            final int restoreCount = canvas.save();

            canvas.rotate(270);
            canvas.translate(-height * 1.5f - scrollY, Math.min(0, scrollX));
            mEdgeGlowLeft.setSize(height * 2, width);
            canvas.translate(-height - scrollY, Math.min(0, scrollX));
            mEdgeGlowLeft.setSize(height, width);
            invalidateForGlow |= mEdgeGlowLeft.draw(canvas);
            canvas.restoreToCount(restoreCount);
        }
@@ -196,9 +196,9 @@ public class OverScrollGlow {
            final int restoreCount = canvas.save();

            canvas.rotate(90);
            canvas.translate(-height / 2 + scrollY,
            canvas.translate(scrollY,
                    -(Math.max(mHostView.computeMaxScrollX(), scrollX) + width));
            mEdgeGlowRight.setSize(height * 2, width);
            mEdgeGlowRight.setSize(height, width);
            invalidateForGlow |= mEdgeGlowRight.draw(canvas);
            canvas.restoreToCount(restoreCount);
        }
+3 −0
Original line number Diff line number Diff line
@@ -3553,6 +3553,9 @@ public class WebView extends AbsoluteLayout
            // When drawing the title bar, move it horizontally to always show
            // at the top of the WebView.
            mTitleBar.offsetLeftAndRight(mScrollX - mTitleBar.getLeft());
            int newTop = Math.min(0, mScrollY);
            mTitleBar.setBottom(newTop + getTitleHeight());
            mTitleBar.setTop(newTop);
        }
        return super.drawChild(canvas, child, drawingTime);
    }