RecylerView Animation

RecylerView Animation

In earlier tutorials we had learned implementation of RecyclerView. Now in this tutorial we will move to RecyclerView Animation part. The best thing of RecyclerView is that it provide inbuilt animations but the ListView and GridView don’t provide inbuilt animation. Now to implement the Animation in RecyclerView it provide some methods that we need to use:

  1. notifyItemRemoved(position) : While removing item from RecyclerView we need to call this method, this method will remove the item from particular position with animation.
  2. notifyItemInserted(position) : If you want to insert item then you need to call this method, this method will insert the item at particular position with animation.
  3. notifyItemChanged(position) : When you want to change row item with any other item then you need to call this method, this method will change the item at particular position.


In this tutorial, we are going to learn how to use implement RecyclerView Animation.


1. Create a new project in Eclipse by navigating to File ⇒ New Android ⇒ Application Project and fill required details. By default my activity is

2. Open strings.xml located under res=>values folder and add following strings.

3. Open your build.gradle file and below dependency to it.

4. Create activity_main.xml and add the following code. In this xml file Toolbar is taken in place of ActionBar and 3 RadioButtons to do three operations on RecyclerView and finally take RecyclerView.

If you are new to RecyclerView visit my RecyclerView tutorial.

5. Now for RecyclerView item row create list_item_row.xml and add views according to your requirement.

6. Open your and the following code to it. In this class we are adding items to RecyclerView and handling RadioButton functionality.

7. Finally create class and add the following code to it. Below are some methods that are used to operate RecyclerView:

  • Delete Item
  • Insert Item
  • Change Item
Now add all these methods to RecyclerView adapter.
Here the clickType is to check which RadioButton is selected for changing its value a method is created:
8. Finally, all done – now you add Animation to your RecyclerView..

Thanks. 🙂

Download Source Code


About the author

I am an Android developer for whom Android is the one and only love. I work as a freelancer which gets me and Android closer. I always love to share my learnings and love to learn from others knowledge too.

Leave a Comment

Comment (required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Name (required)
Email (required)