
Member-only story
Enter animation using RecyclerView and LayoutAnimation Part 1: Lists
Learn how to populate an empty RecyclerView list 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
In this tutorial we’ll learn an easy way to add an initial content animation for a RecyclerView. There are some ways of doing this, e.g.:
- Implementing a custom ItemAnimator
- Add animation handling to
onBindViewHolder()
in the Adapter
We’ll be using a third option, LayoutAnimation. It’s easy and only requires a small amount of code. It’s worth noting that though this tutorial is focused around RecyclerViews, LayoutAnimations can be applied to any subclass of ViewGroup.
The tutorial will go through:
- Defining an animation for each item
- Defining a LayoutAnimation using the item animation
- Applying the LayoutAnimation programmatically and in XML
This is the first post in a two post series and covers the case where the RecyclerView is a list (using a LinearLayoutManager
). The solutions presented here also works when using a GridLayoutManager
, however as we’ll see in the second part there is a way to create a better experience for grids:
The demo app project shown in this tutorial, containing examples for both Lists and Grids, is available here: