
Member-only story
Enter animation using RecyclerView and LayoutAnimation Part 2: Grids
Learn how to populate an empty RecyclerView grid using custom animations.

Series
- Enter animation using RecyclerView and LayoutAnimation Part 1: Lists
- Enter animation using RecyclerView and LayoutAnimation Part 2: Grids
- Enter animation using RecyclerView and LayoutAnimation Part 3: Exclude items
Introduction
This is the second and final part in the series on how to apply a LayoutAnimation to a RecyclerView. Part 1 covered the case where the RecyclerView is used for a List and can be found here:
In Part 1 we showed how to populate an empty RecyclerView using custom animations. This was done using LayoutAnimation’s and it works well when the RecyclerView represents a list. This second part will focus on how the same method can be applied to grids as well, with a little tweaking.
The demo app project shown in this tutorial, containing examples for both Lists and Grids, is available here:
and an APK of the example project can be found here!
How is the grid case different?
First of everything from Part 1 will work fine on a grid, it won’t crash and the animations will be applied in the same way. However the end result of combining a LayoutAnimation with a RecyclerView that uses a GridLayoutManager gives the following end result: