Animation for list reloading

As we know from android design guides, content should come to the screen from the edges in meaningful way. So, I decided to animate showing content of my list and also to add animation for reloading the list. I’ve used RecyclerView for my list of cards. It has a few build-in animations + we can set animation in onBindViewHolder method for every view-item. But for my task, I’ve decided to animate whole list itself.

I’ve started from showing the content first time. For this, I’ve created bottom_up.xml  animation file:

and use it right after listView.setAdapter(adapter) method:

Reloading list animation

Next step is to implement reloading list animation. For the showing new data we can use the same approach as described before, but we also need to hide old content with some animation. To implement this, I’ve use some hack – first of all, we can put ImageView below list in fragment’s layout:

Now, before setting new data into list, we can  “make screenshot” of our current list view, set this image to ImageView and animatedly hide it:

hideOldAnimation  – any animation we want to use… in my case this is fade out + scale down animation:

In the result we get nice animation for showing\reloading list:

This animation are not 100% Material Design approach and may be improved soon 🙂

Leave a Reply