diff options
| author | 2010-12-07 16:10:57 -0800 | |
|---|---|---|
| committer | 2010-12-07 16:10:57 -0800 | |
| commit | 1a94f3b582a75466bb8e73fbff477d837fb88850 (patch) | |
| tree | a2d88760dcb26ce05729853bc1be7e76e71d4e0c | |
| parent | debfb7fc01b01b2f7a4e165bfc81ee699f6f518a (diff) | |
| parent | b1297f76351795822c64236c4ce27b97d18e5bca (diff) | |
Merge "Make horizotnalscrollview and scrollview edgeglows match the new algorithm."
| -rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 9 | ||||
| -rw-r--r-- | core/java/android/widget/ScrollView.java | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index c05e3ad3027a..50867b9514d0 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -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(); } diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index 9fa90dc3c80f..f25edd8c05df 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -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(); } |