We mostly use spinner loaders or some kinds of animations like 3 dots etc. when we load the content of our app. but Facebook's shimmer animation makes loading of the content more attractive to look at.

We can show up shimmer effect on any layout in our app, it can be a grid view or a list view.
You can find shimmer effect in the Facebook app and many others use this nowadays.

Preview of Shimmer Animation :


Use Facebook Shimmer Animation in your Android Studio Project


Facebook Shimmer Setup In Android Studio

1. Add Dependencies to build. gradle file.


Check for Updates in the library - Facebook Github

2. Add below values to the colours.xml file in the res > values folder.



3. Create a new XML resource in res > values folder with a name dimens.xml (refers to dimensions, you can change dimensions here )



4. Now create a layout named as place_holder.xml in res > layout (This will be the layout on which shimmer animation will be shown)



5. As placeholder is ready we need to show it on the main activity where we access the data received from the server.
now we need to add place holders to the MainActivity.



6. In MainActivity.java we can start animation by calling startShimmerAnimation()  method
and we call onResume() & onPause() methods to make shimmer animation visible and invisible.