Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3af8c96b authored by Vu Thanh Cong's avatar Vu Thanh Cong
Browse files

Fix edge effect not showing up on first scroll



This CL fixes a bug in AbsListView when it was not invalidating
mEdgeGlowTop and mEdgeGlowBottom region since the bound of these
EdgeEffect were not set. This was triggering a bug that no edge effect
(overscroll animation) show up on the 1st scroll in ListView.

Bug: N/A
Test: manual - check 1st overscroll animation on a ListView activity

Change-Id: Ic76b894f8e21f9b16651d246bc73ebeaef08fa21
Signed-off-by: default avatarVu Thanh Cong <vuthanhcong.ict@gmail.com>
parent 836e7405
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4321,13 +4321,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();
                }
@@ -4342,7 +4343,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();
                }