A Jetpack Compose library that provides Compose support for Glide.
- Add the dependency
dependencies {
implementation 'io.github.cjchen98:NetworkImage-Compose:0.1.1'
}
- Provide a Glide
RequestManager
instance to your root Compose tree:
setContent {
ProvideGlideLoader {
Home()
}
}
NetworkImage(
url: String,/*image url */
modifier: Modifier = Modifier,
contentDescription: String? = null,
onLoading: {/* the widget to be displayed while the image is being downloaded*/ },
onFailure: {/* the widget to be displayed if an error occurs*/},
)