Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created September 9, 2024 11:44
Show Gist options
  • Save skydoves/c6acdbe0a91b8fc8d2e92079e2da5cbd to your computer and use it in GitHub Desktop.
Save skydoves/c6acdbe0a91b8fc8d2e92079e2da5cbd to your computer and use it in GitHub Desktop.
consume_imageui
@Composable
fun ConsumeImageUi(
imageUi: ImageUi,
modifier: Modifier = Modifier,
imageOptions: ImageOptions? = null
) {
GlideImage(
modifier = modifier
.size(imageUi.size)
.clip(RoundedCornerShape(8.dp)),
imageModel = { imageUi.url },
imageOptions = imageOptions ?: ImageOptions(
contentScale = imageUi.scaleType.toContentScale(),
contentDescription = imageUi.title
),
previewPlaceholder = painterResource(R.drawable.preview)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment