Coil3: also show the loader when the request is not yet started (State.Empty)
This commit is contained in:
@@ -102,7 +102,7 @@ fun StaticMapView(
|
||||
)
|
||||
} else {
|
||||
StaticMapPlaceholder(
|
||||
showProgress = collectedState.value is AsyncImagePainter.State.Loading,
|
||||
showProgress = collectedState.value.isLoading(),
|
||||
contentDescription = contentDescription,
|
||||
width = maxWidth,
|
||||
height = maxHeight,
|
||||
@@ -112,6 +112,11 @@ fun StaticMapView(
|
||||
}
|
||||
}
|
||||
|
||||
private fun AsyncImagePainter.State.isLoading(): Boolean {
|
||||
return this is AsyncImagePainter.State.Empty ||
|
||||
this is AsyncImagePainter.State.Loading
|
||||
}
|
||||
|
||||
@PreviewsDayNight
|
||||
@Composable
|
||||
internal fun StaticMapViewPreview() = ElementPreview {
|
||||
|
||||
Reference in New Issue
Block a user