Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add callback aboutToDismiss in SwipeDismissListViewTouchListener #19

Closed
wants to merge 1 commit into from
Closed

Conversation

nktrk
Copy link

@nktrk nktrk commented Jun 25, 2014

With a more elaborate adapter, for instance one that's touching a database (in my case the ObjectCursorAdapter), I noticed that the swipe to dismiss behavior was very jumpy and would flash the dismissed item briefly before removing it from the list.

Also, when I accessed the last item in the list object in onDismiss with adapter.getItem(position), I would receive null, stopping me from updating that object.

Adding a hook to alter objects before the dismiss occurs allowed me to update the object at that position and made the remove item much smoother (no flash of dismissed item).

It's only two lines of code, updated the docs and confirmed working in your sample app.

…hListener to allow for editing of cell data before the dismiss event alters positions
@nktrk nktrk closed this Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant