RecyclerView Drag to Reorder and Swipe to Delete with Undo in Snackbar
1. You can use the sample project from this blog post as a base for your new project, which will use RecyclerView list to display a list of items. Long press and drag each item to reorder. Swipe to delete.
2. To add undo delete functionality to the above sample code, you can use codes from this thread on Stack Overflow.
3. This gist will show you a more complete source code for undo delete. One thing to note is that I cannot find the PhotoRemoveService used in this gist. I guess it is up to our own implementation. You may want to read a chapter on Services from The Busy Coder’s book below.
4. This is an alternative to RecyclerView. The project includes a complete code for ListView items with drag to reorder and swipe to delete with undo functionalities. Thanks to a Romanian developer who sent me this code.
In addition to the book, the authors provide app development and consulting services.
If you’re completely new to Android programming, The Big Nerd book is a good starting point. As you work on your project, The Busy Coder’s Guide will come in handy, in addition to Google, Stack Overflow, blog posts, and Android official documentation.
If you have questions or comments, please feel free to leave it in the comment box.