Merge "Fix edge effect not showing up on first scroll" am: 894d8cf470 am: 391a7c381d

am: bc7b84e463

Change-Id: I2ac88eeed21db2767fbc2a01070d1905a2a74697
This commit is contained in:
Vu Thanh Cong
2018-07-25 10:48:29 -07:00
committed by android-build-merger

View File

@@ -4337,13 +4337,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
translateX = 0;
translateY = 0;
}
mEdgeGlowTop.setSize(width, height);
mEdgeGlowBottom.setSize(width, height);
if (!mEdgeGlowTop.isFinished()) {
final int restoreCount = canvas.save();
canvas.clipRect(translateX, translateY,
translateX + width ,translateY + mEdgeGlowTop.getMaxHeight());
final int edgeY = Math.min(0, scrollY + mFirstPositionDistanceGuess) + translateY;
canvas.translate(translateX, edgeY);
mEdgeGlowTop.setSize(width, height);
if (mEdgeGlowTop.draw(canvas)) {
invalidateTopGlow();
}
@@ -4358,7 +4359,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
- (clipToPadding ? mPaddingBottom : 0);
canvas.translate(edgeX, edgeY);
canvas.rotate(180, width, 0);
mEdgeGlowBottom.setSize(width, height);
if (mEdgeGlowBottom.draw(canvas)) {
invalidateBottomGlow();
}