For more detail article please kindly read : Swipe for delete, edit and share item on Recyclerview
In this tutorial, i still use THIS PROJECT, so i just post the code that related with swipe function.
There is no much steps you will do, just write a several line codes in your MainActivity.java or wherever you define your Recyclerview. In this case, I define the Recyler view in MainActivity.java
For Undo function, we will use on the the newest materials called Snackbar. Snackbar will appears at the bottom when you delete the item.
For use Snackbar, make sure you have compiled this library in your build.gradle(Module:app) :
After that, in you class where you define the recyclerview, paste the code below :
That's all, enjoy it!!