Jetpack Compose: LottieSwipeRefreshIndicator

Simplest way to use Lottie Files as a SwipeRefreshLayout

Just a quick note, here is how to use CustomSwipeRefresh in accompanist using LottieRefreshIndicator

Use it in coordination with accompanist swipe refresh

Be sure to add this library in the build.gralde

implementation “”

var loading by viewModel.loading.collectAsState() //observerAsState for livedata

state = rememberSwipeRefreshState(isRefreshing = !loading),
onRefresh = {
indicator = { state, trigger ->
LottieRefreshIndicator(state = state, refreshTriggerDistance = trigger, animation = R.raw.monitor_progress)
) {

Here is the LottieRefreshIndicator file:

Visit the example here at




Lead Android Developer, Flutter Lover

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Day36 of #100DaysOfCode

How To Create an Android App with Dark Mode

Android Messages App Codenames

Handling OnBackPressed() in Fragments

Reduce, Reuse & Recycle your thread pools ♻️

Using MySQL Database in Android Apps

Day72 of #100DaysOfCode

JvmSuppressWildcards: The secret sauce to your sandwich-style generics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nabil Mosharraf Hossain

Nabil Mosharraf Hossain

Lead Android Developer, Flutter Lover

More from Medium

Fundamentals of Jetpack Compose

Compose Destinations: A simpler way for compose navigation.

Routes & Arguments In Jetpack Compose Navigation

Jetpack compose custom rating bar in android 2022