hudomju / android-swipe-to-dismiss-undo

Android swipe-to-dismiss-undo library and sample code
MIT License
239 stars 84 forks source link

onDismiss method not being called #29

Open diogonunes92 opened 8 years ago

diogonunes92 commented 8 years ago

I call a Log on the method:

final SwipeToDismissTouchListener<ListViewAdapter> touchListener =
                new SwipeToDismissTouchListener<>(
                        new ListViewAdapter(listView),
                        new SwipeToDismissTouchListener.DismissCallbacks<ListViewAdapter>() {
                            @Override
                            public boolean canDismiss(int position) {
                                System.err.println("Can dismiss!");
                                return true;
                            }

                            @Override
                            public void onDismiss(ListViewAdapter view, int position) {
                                adapter.remove(position);
                                deleteFavourite(addresses.get(position));
                                System.err.println("Dismissed!");
                            }
                        });

And adding to the fact that the list item is not actually deleted from the database (the deleteFavourite() function is not called, the System.err.println is not called either. The item is removed from the list though so i'm a bit confused!