Skip to content

Commit 6fcf27d

Browse files
committed
fixing touchslop changes
1 parent 0dbd6b0 commit 6fcf27d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/src/main/java/com/daimajia/swipe/SwipeLayout.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -843,15 +843,15 @@ public boolean onTouchEvent(MotionEvent event) {
843843
if (getOpenStatus() == Status.Close) {
844844
int lastCurrentDirectionIndex = currentDirectionIndex;
845845
if (angle < 45) {
846-
if (mLeftIndex != -1 && distanceX > mTouchSlop) {
846+
if (mLeftIndex != -1 && distanceX > 0) {
847847
currentDirectionIndex = mLeftIndex;
848-
} else if (mRightIndex != -1 && distanceX < -mTouchSlop) {
848+
} else if (mRightIndex != -1) {
849849
currentDirectionIndex = mRightIndex;
850850
}
851851
} else {
852-
if (mTopIndex != -1 && distanceY < -mTouchSlop) {
852+
if (mTopIndex != -1 && distanceY < 0) {
853853
currentDirectionIndex = mTopIndex;
854-
} else if (mBottomIndex != -1 && distanceY > mTouchSlop) {
854+
} else if (mBottomIndex != -1) {
855855
currentDirectionIndex = mBottomIndex;
856856
}
857857
}

0 commit comments

Comments
 (0)