Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Add canDismiss do OnDismissCallback for ListViews. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public interface OnDismissCallback {
* order for convenience.
*/
void onDismiss(ListView listView, int[] reverseSortedPositions);
boolean canDismiss(ListView listView, int position);
}

/**
Expand Down Expand Up @@ -227,7 +228,7 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
dismiss = true;
dismissRight = mVelocityTracker.getXVelocity() > 0;
}
if (dismiss) {
if (dismiss && mCallback.canDismiss(mListView, mDownPosition)) {
// dismiss
final View downView = mDownView; // mDownView gets null'd before animation ends
final int downPosition = mDownPosition;
Expand Down