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

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

Merge "Make horizotnalscrollview and scrollview edgeglows match the new algorithm."

parents debfb7fc b1297f76
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1420,8 +1420,8 @@ public class HorizontalScrollView extends FrameLayout {
                final int height = getHeight();

                canvas.rotate(270);
                canvas.translate(-height * 1.5f, Math.min(0, scrollX));
                mEdgeGlowLeft.setSize(getHeight() * 2, getWidth());
                canvas.translate(-height, Math.min(0, scrollX));
                mEdgeGlowLeft.setSize(getHeight(), getWidth());
                if (mEdgeGlowLeft.draw(canvas)) {
                    invalidate();
                }
@@ -1433,8 +1433,9 @@ public class HorizontalScrollView extends FrameLayout {
                final int height = getHeight();

                canvas.rotate(90);
                canvas.translate(-height / 2, -(Math.max(getScrollRange(), scrollX) + width));
                mEdgeGlowRight.setSize(height * 2, width);
                canvas.translate(0,
                        -(Math.max(getScrollRange(), scrollX) + width));
                mEdgeGlowRight.setSize(height, width);
                if (mEdgeGlowRight.draw(canvas)) {
                    invalidate();
                }
+4 −4
Original line number Diff line number Diff line
@@ -1467,8 +1467,8 @@ public class ScrollView extends FrameLayout {
                final int restoreCount = canvas.save();
                final int width = getWidth();

                canvas.translate(-width / 2, Math.min(0, scrollY));
                mEdgeGlowTop.setSize(width * 2, getHeight());
                canvas.translate(0, Math.min(0, scrollY));
                mEdgeGlowTop.setSize(width, getHeight());
                if (mEdgeGlowTop.draw(canvas)) {
                    invalidate();
                }
@@ -1479,9 +1479,9 @@ public class ScrollView extends FrameLayout {
                final int width = getWidth();
                final int height = getHeight();

                canvas.translate(-width / 2, Math.max(getScrollRange(), scrollY) + height);
                canvas.translate(-width, Math.max(getScrollRange(), scrollY) + height);
                canvas.rotate(180, width, 0);
                mEdgeGlowBottom.setSize(width * 2, height);
                mEdgeGlowBottom.setSize(width, height);
                if (mEdgeGlowBottom.draw(canvas)) {
                    invalidate();
                }