Now there is a new library called ShimmerRecyclerview , which is based on Facebook Shimmer
To use it, you define your recyclerview xml as follows:
<com.cooltechworks.views.shimmer.ShimmerRecyclerView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/shimmer_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" app:demo_child_count="10" app:demo_grid_child_count="2" app:demo_layout="@layout/layout_demo_grid" app:demo_layout_manager_type="grid" />
Attribute
demo_layout is the location of the template.
To show a flickering layout, call:
shimmerRecycler.showShimmerAdapter();
And to hide it:
shimmerRecycler.hideShimmerAdapter();
ajdeguzman
source share