Permalink
Browse files

Merge pull request #91 from laysionqet/master

little adjustment
  • Loading branch information...
2 parents f028642 + c5c0ae2 commit e4ddae6d2b8af9b606493cba36faef8beba94be2 @ikew0ng committed Oct 12, 2015
Showing with 13 additions and 2 deletions.
  1. +13 −2 library/src/main/java/me/imid/swipebacklayout/lib/SwipeBackLayout.java
@@ -496,7 +496,16 @@ public boolean tryCaptureView(View view, int i) {
}
mIsScrollOverValid = true;
}
- return ret;
+ boolean directionCheck = false;
+ if (mEdgeFlag == EDGE_LEFT || mEdgeFlag == EDGE_RIGHT) {
+ directionCheck = !mDragHelper.checkTouchSlop(ViewDragHelper.DIRECTION_VERTICAL, i);
+ } else if (mEdgeFlag == EDGE_BOTTOM) {
+ directionCheck = !mDragHelper
+ .checkTouchSlop(ViewDragHelper.DIRECTION_HORIZONTAL, i);
+ } else if (mEdgeFlag == EDGE_ALL) {
+ directionCheck = true;
+ }
+ return ret & directionCheck;
}
@Override
@@ -538,8 +547,10 @@ public void onViewPositionChanged(View changedView, int left, int top, int dx, i
}
if (mScrollPercent >= 1) {
- if (!mActivity.isFinishing())
+ if (!mActivity.isFinishing()) {
mActivity.finish();
+ mActivity.overridePendingTransition(0, 0);
+ }
}
}

0 comments on commit e4ddae6

Please sign in to comment.