O'Reilly logo

Mastering Android Application Development by Antonio Pachón Ruiz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing RecyclerView

The RecyclerView was introduced in Android 5.0 Lollipop and was defined by Google as a more flexible and advanced version of ListView. It is based on an Adapter class similar to ListView, but it enforces the use of a ViewHolder class to improve performance and modularity, as we have seen in the previous section. The flexibility comes in when we decouple the item representation from the component and allow animations, item decorations, and layout managers to do the work.

The RecyclerView handles the adding and removing of animations using RecyclerView.ItemAnimator, which we can subclass to customize the animations. If you display data from a source or if the data changes, for instance by adding or removing items, you can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required