Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created January 4, 2026 08:57
Show Gist options
  • Select an option

  • Save skydoves/ff57ccac9949ba6eb66a0f3f4c09b920 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/ff57ccac9949ba6eb66a0f3f4c09b920 to your computer and use it in GitHub Desktop.
Landscapist: Loading State Composables
LandscapistImage(
model = imageUrl,
loading = {
Box(modifier = Modifier.matchParentSize()) {
CircularProgressIndicator(
modifier = Modifier.align(Alignment.Center)
)
}
},
success = { state ->
Image(
bitmap = state.imageBitmap,
contentDescription = null,
modifier = Modifier.matchParentSize()
)
},
failure = { state ->
Icon(
imageVector = Icons.Default.BrokenImage,
contentDescription = "Failed to load",
modifier = Modifier.align(Alignment.Center)
)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment