

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. This example demonstrate about how to update Recycler View adapter by creating a beautiful student records app that displays student name with age. Using recycler view we can show grids and list of items. Recycler view is more advanced version of list view and it works based on View holder design pattern. Import 7. getting into example, we should know what is Recycler view in android. The code for the MainActivity.java is given below: package The code for the activity_main.xml layout which contains a RecyclerView only is given below: Let’s start building our android application with the drag and drop feature on the RecyclerView. clearView - This method gets triggered when the user interaction stops with the RecyclerView row.For example, changing the background color. Here we can customize the RecyclerView row. onSelectedChanged - Based on the current state of the RecyclerView and whether it’s pressed or swiped, this method gets triggered.We’ll keep this empty in the current tutorial. onSwipe - Here we implement the code for swiping.

onMove - Here we set the code for the drag and drop.getMovementFlags - Here we pass the flags for the directions of drag and swipe.

