Merge "Make horizotnalscrollview and scrollview edgeglows match the new algorithm."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1a94f3b582
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user