Article is on dev.to click below 👇
App's Overview
-
In this article I am gonna take you through the development of Swipe Delete Feature, specifically we are going to delete the data present in Cloud Firestore Database in just a swipe.
-
Sounds amazing, yes it is amazing, let's start :
Note:
The article only contains the explanation of "swipe to delete" feature, firebase implementation and UI details are not discussed, but I will provide the GitHub from which you can easily go through the complete code of the app.
Table Of Content
##Dependencies Setup
- I have used an external library to create and decorate the swipe to delete feature, it is called RecyclerViewSwipeDecorator.
dependencies{
implementation 'it.xabaras.android:recyclerview-swipedecorator:1.2.3'
}
Code Explanation
- Create an
ItemTouchHelper.SimpleCallback
, instantiate anItemTouchHelper
with this callback. - Copy the code snippet below 👇
Reference -…