fixing touchslop changes

This commit is contained in:
HarshEvilGeek 2015-02-11 13:53:56 +05:30
parent 0dbd6b024b
commit 6fcf27d4ce
1 changed files with 4 additions and 4 deletions

View File

@ -843,15 +843,15 @@ public class SwipeLayout extends FrameLayout {
if (getOpenStatus() == Status.Close) {
int lastCurrentDirectionIndex = currentDirectionIndex;
if (angle < 45) {
if (mLeftIndex != -1 && distanceX > mTouchSlop) {
if (mLeftIndex != -1 && distanceX > 0) {
currentDirectionIndex = mLeftIndex;
} else if (mRightIndex != -1 && distanceX < -mTouchSlop) {
} else if (mRightIndex != -1) {
currentDirectionIndex = mRightIndex;
}
} else {
if (mTopIndex != -1 && distanceY < -mTouchSlop) {
if (mTopIndex != -1 && distanceY < 0) {
currentDirectionIndex = mTopIndex;
} else if (mBottomIndex != -1 && distanceY > mTouchSlop) {
} else if (mBottomIndex != -1) {
currentDirectionIndex = mBottomIndex;
}
}