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

Commit f5188cf6 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix EdgeEffect clipping and AbsListView's use of it" into lmp-preview-dev

parents 1bb44372 9be22455
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -4028,12 +4028,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            final int scrollY = mScrollY;
            if (!mEdgeGlowTop.isFinished()) {
                final int restoreCount = canvas.save();
                final int leftPadding = mListPadding.left + mGlowPaddingLeft;
                final int rightPadding = mListPadding.right + mGlowPaddingRight;
                final int width = getWidth() - leftPadding - rightPadding;
                final int width = getWidth();

                int edgeY = Math.min(0, scrollY + mFirstPositionDistanceGuess);
                canvas.translate(leftPadding, edgeY);
                canvas.translate(0, edgeY);
                mEdgeGlowTop.setSize(width, getHeight());
                if (mEdgeGlowTop.draw(canvas)) {
                    invalidate(0, 0, getWidth(),
@@ -4043,12 +4041,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            }
            if (!mEdgeGlowBottom.isFinished()) {
                final int restoreCount = canvas.save();
                final int leftPadding = mListPadding.left + mGlowPaddingLeft;
                final int rightPadding = mListPadding.right + mGlowPaddingRight;
                final int width = getWidth() - leftPadding - rightPadding;
                final int width = getWidth();
                final int height = getHeight();

                int edgeX = -width + leftPadding;
                int edgeX = -width;
                int edgeY = Math.max(height, scrollY + mLastPositionDistanceGuess);
                canvas.translate(edgeX, edgeY);
                canvas.rotate(180, width, 0);
+1 −2
Original line number Diff line number Diff line
@@ -312,8 +312,7 @@ public class EdgeEffect {
        final float displacement = Math.max(0, Math.min(mDisplacement, 1.f)) - 0.5f;
        float translateX = mBounds.width() * displacement / 2;

        canvas.clipRect(Float.MIN_VALUE, mBounds.top,
                Float.MAX_VALUE, Float.MAX_VALUE);
        canvas.clipRect(mBounds);
        canvas.translate(translateX, 0);
        canvas.drawArc(mArcRect, 45, 90, true, mPaint);
        canvas.restoreToCount(count);