PlaceHolderRecyclerView

This libs doesn't force a placehoder type, the developer is responsible for creating one, checkout the sample module and see how simple it is.

You can use the best beloved Shimmer-Android, a Lottie animation or even Property Animation. Use your imagination, it's your placeholder.

stone

lottie

emoji

Installation

PlaceHolderRecyclerView is distributed through Maven Central, Jcenter and Jitpack.

implementation 'com.github.guilhe:placeholder-recyclerview:${LATEST_VERSION}'

Maven Central Download Bintray

Usage

<com.github.guilhe.views.PlaceHolderRecyclerView
        android:id="@+id/my_RecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
class MyItemsPlaceHolderAdapter : ..., PlaceHolderAdapter { ... }

private val itemsAdapter = MyItemsAdapter()
...
with(binding.myRecyclerView) {
    adapter = itemsAdapter
    holdersAdapter = MyItemsPlaceHolderAdapter()
    holdersItemDecoration = MyItemsDecoration() //if needed
}
...
viewModel.items.observe(this, { itemsAdapter.update(it) })
viewModel.isLoading.observe(this, { isLoading -> binding.myRecyclerView.toggleHoldersAdapter(isLoading) })

sample

GitHub