Skip to content

Commit

Permalink
Fix Error when swipe down #75
Browse files Browse the repository at this point in the history
  • Loading branch information
soarcn committed Aug 30, 2015
1 parent c8702a1 commit 7744e13
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ private void expand(View releasedChild, float yvel) {

private void dismiss(View view, float yvel) {
mDragHelper.smoothSlideViewTo(view, 0, top + height);
mDragHelper.cancel();
ViewCompat.postInvalidateOnAnimation(ClosableSlidingLayout.this);
}

Expand Down Expand Up @@ -201,9 +200,9 @@ public void onViewReleased(View releasedChild, float xvel, float yvel) {
dismiss(releasedChild, yvel);
} else {
mDragHelper.smoothSlideViewTo(releasedChild, 0, top);
ViewCompat.postInvalidateOnAnimation(ClosableSlidingLayout.this);
}
}
ViewCompat.postInvalidateOnAnimation(ClosableSlidingLayout.this);
}

@Override
Expand All @@ -212,7 +211,9 @@ public void onViewPositionChanged(View changedView, int left, int top, int dx, i
invalidate();
}
if (height - top < 1 && mListener != null) {
mDragHelper.cancel();
mListener.onClosed();
mDragHelper.smoothSlideViewTo(changedView, 0, top);
}
}

Expand Down

0 comments on commit 7744e13

Please sign in to comment.