Merge "Fix bug 3362273 - Make overscroll glow appear within padding region"
This commit is contained in:
@@ -3267,9 +3267,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
||||
final int scrollY = mScrollY;
|
||||
if (!mEdgeGlowTop.isFinished()) {
|
||||
final int restoreCount = canvas.save();
|
||||
final int width = getWidth();
|
||||
final int width = getWidth() - mListPadding.left - mListPadding.right;
|
||||
|
||||
canvas.translate(0, Math.min(0, scrollY + mFirstPositionDistanceGuess));
|
||||
canvas.translate(mListPadding.left,
|
||||
Math.min(0, scrollY + mFirstPositionDistanceGuess));
|
||||
mEdgeGlowTop.setSize(width, getHeight());
|
||||
if (mEdgeGlowTop.draw(canvas)) {
|
||||
invalidate();
|
||||
@@ -3278,10 +3279,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
||||
}
|
||||
if (!mEdgeGlowBottom.isFinished()) {
|
||||
final int restoreCount = canvas.save();
|
||||
final int width = getWidth();
|
||||
final int width = getWidth() - mListPadding.left - mListPadding.right;
|
||||
final int height = getHeight();
|
||||
|
||||
canvas.translate(-width, Math.max(height, scrollY + mLastPositionDistanceGuess));
|
||||
canvas.translate(-width + mListPadding.left,
|
||||
Math.max(height, scrollY + mLastPositionDistanceGuess));
|
||||
canvas.rotate(180, width, 0);
|
||||
mEdgeGlowBottom.setSize(width, height);
|
||||
if (mEdgeGlowBottom.draw(canvas)) {
|
||||
|
||||
@@ -1422,11 +1422,11 @@ public class HorizontalScrollView extends FrameLayout {
|
||||
final int scrollX = mScrollX;
|
||||
if (!mEdgeGlowLeft.isFinished()) {
|
||||
final int restoreCount = canvas.save();
|
||||
final int height = getHeight();
|
||||
final int height = getHeight() - mPaddingTop - mPaddingBottom;
|
||||
|
||||
canvas.rotate(270);
|
||||
canvas.translate(-height, Math.min(0, scrollX));
|
||||
mEdgeGlowLeft.setSize(getHeight(), getWidth());
|
||||
canvas.translate(-height + mPaddingTop, Math.min(0, scrollX));
|
||||
mEdgeGlowLeft.setSize(height, getWidth());
|
||||
if (mEdgeGlowLeft.draw(canvas)) {
|
||||
invalidate();
|
||||
}
|
||||
@@ -1435,10 +1435,10 @@ public class HorizontalScrollView extends FrameLayout {
|
||||
if (!mEdgeGlowRight.isFinished()) {
|
||||
final int restoreCount = canvas.save();
|
||||
final int width = getWidth();
|
||||
final int height = getHeight();
|
||||
final int height = getHeight() - mPaddingTop - mPaddingBottom;
|
||||
|
||||
canvas.rotate(90);
|
||||
canvas.translate(0,
|
||||
canvas.translate(-mPaddingTop,
|
||||
-(Math.max(getScrollRange(), scrollX) + width));
|
||||
mEdgeGlowRight.setSize(height, width);
|
||||
if (mEdgeGlowRight.draw(canvas)) {
|
||||
|
||||
@@ -1470,9 +1470,9 @@ public class ScrollView extends FrameLayout {
|
||||
final int scrollY = mScrollY;
|
||||
if (!mEdgeGlowTop.isFinished()) {
|
||||
final int restoreCount = canvas.save();
|
||||
final int width = getWidth();
|
||||
final int width = getWidth() - mPaddingLeft - mPaddingRight;
|
||||
|
||||
canvas.translate(0, Math.min(0, scrollY));
|
||||
canvas.translate(mPaddingLeft, Math.min(0, scrollY));
|
||||
mEdgeGlowTop.setSize(width, getHeight());
|
||||
if (mEdgeGlowTop.draw(canvas)) {
|
||||
invalidate();
|
||||
@@ -1481,10 +1481,11 @@ public class ScrollView extends FrameLayout {
|
||||
}
|
||||
if (!mEdgeGlowBottom.isFinished()) {
|
||||
final int restoreCount = canvas.save();
|
||||
final int width = getWidth();
|
||||
final int width = getWidth() - mPaddingLeft - mPaddingRight;
|
||||
final int height = getHeight();
|
||||
|
||||
canvas.translate(-width, Math.max(getScrollRange(), scrollY) + height);
|
||||
canvas.translate(-width + mPaddingLeft,
|
||||
Math.max(getScrollRange(), scrollY) + height);
|
||||
canvas.rotate(180, width, 0);
|
||||
mEdgeGlowBottom.setSize(width, height);
|
||||
if (mEdgeGlowBottom.draw(canvas)) {
|
||||
|
||||
Reference in New Issue
Block a user