Skip to content

Drag and drop the list item anywhere in the list and Swipe to delete the item

Notifications You must be signed in to change notification settings

ThameemAK/DragandSwipeListView

Repository files navigation

DragandSwipeListView

Drag and drop the list item anywhere in the list and Swipe to delete the item



For “drag & drop” and “swipe-to-dismiss” there are many tutorials, libraries, and examples available in Android using RecyclerView. There is simple way to add this functionality using one class, and it’s already part of the Android Support Library.

ItemTouchHelper - It is subclass of RecyclerView.ItemDecoration. It takes care of everything.

Must override the following callback methods :

getMovementFlags(RecyclerView, ViewHolder)

onMove(RecyclerView, ViewHolder, ViewHolder)

onSwiped(ViewHolder, int)

There is couple of method available to enable & disable :

isLongPressDragEnabled()

isItemViewSwipeEnabled()

About

Drag and drop the list item anywhere in the list and Swipe to delete the item

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published