Fix race condition that skips corner updates on half swipe

Set mIsSwiping true before calling SwipeHelper#Callback#onBeginDrag;
otherwise onBeginDrag may use an outdated false and mistakenly include
the swiped view as part of a rounded section.

Fixes: 173753021
Bug: 171817112
Test: half swipe first and last notifs in section; corners always update
Change-Id: I115d30b10657b6edbf94d4d444058bdeeaf9000e
This commit is contained in:
Lyn Han
2020-11-23 22:19:17 -06:00
parent 44e16cd59f
commit 62d72f2e75

View File

@@ -327,8 +327,8 @@ public class SwipeHelper implements Gefingerpoken {
if (Math.abs(delta) > pagingTouchSlop
&& Math.abs(delta) > Math.abs(deltaPerpendicular)) {
if (mCallback.canChildBeDragged(mTouchedView)) {
mCallback.onBeginDrag(mTouchedView);
mIsSwiping = true;
mCallback.onBeginDrag(mTouchedView);
mInitialTouchPos = getPos(ev);
mTranslation = getTranslation(mTouchedView);
}