This is the fourth part of the complete mini course on RecyclerView. In this tutorial, I will show you step by step how to add the swipe to delete functionality into the RecyclerView. You will learn how to create an ItemTouchHelper with a SimpleCallback object, and then I will show you how to attach the object to the RecyclerView with the help of attachToRecyclerView method. In the onSwipe callback, we will delete the item in the list, and then we will notify the RecyclerView that a change has happened so that the RecyclerView gets updated once the user swipes to the left.

About RecyclerView
The RecyclerView is a ViewGroup that renders any adapter-based view in a similar way. It is supposed to be the successor of ListView and GridView. One of the reasons is that RecyclerView has a more extensible framework, especially since it provides the ability to implement both horizontal and vertical layouts. Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network events.

#android #mobile-apps #programming #developer

RecyclerView Swipe to Delete in Android Studio
3.15 GEEK