Animating recycler view decorator

Most people are aware that for Recycler View, to draw the border etc, we don’t use margin, but instead use decorator. However can we animate it?

By default it can’t perform any animation. There’s nothing mentioned about animation in the official documentation nor any tutorial.

The closest I found is leveraging on the ItemAnimator of recycler view to help it in its animation. And it doesn’t continuously animate, and there’s no sample code.

It took a while before I figure out, and sharing with you.

Example Animations

To do that, I have manage to successfully animate on the decorator, using a 3rd party animated view libraries (the 2 circle loading views), as well as my own drawing animation (the simple rectangle shrink and expand animation)

You could get the code here

--

--