hudomju / android-swipe-to-dismiss-undo

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

Typo with the RecyclerView usage Readme #1

Closed bvanhou closed 9 years ago

bvanhou commented 9 years ago

You currently have the documentation on the Usage Read.me incorrect for the RecyclerView. Something small though it drove me insane figuring out what was wrong.

It is currently : final SwipeToDismissTouchListener touchListener = new SwipeToDismissTouchListener

It should be : final SwipeToDismissTouchListener touchListener = new SwipeToDismissTouchListener<>

Otherwise this is fantastic man! great job.

bvanhou commented 9 years ago

This is what you have in the sample and it works just need to alter the Read.me file

    final SwipeToDismissTouchListener<RecyclerViewAdapter> touchListener =
            new SwipeToDismissTouchListener<>(
                    new RecyclerViewAdapter(recyclerView),
                    new SwipeToDismissTouchListener.DismissCallbacks<RecyclerViewAdapter>() {
                        @Override
                        public boolean canDismiss(int position) {
                            return true;
                        }

                        @Override
                        public void onDismiss(RecyclerViewAdapter recyclerViewAdapter, int position) {
                            mAdapter.remove(items.get(position);
                        }

                    });
hudomju commented 9 years ago

Thanks a lot, the markdown preview was doing something wrong. It's fixed now!