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();
}
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)) {
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();
}
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)) {
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();
}
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)) {