Don't show wikipedia image if it's empty
This commit is contained in:
parent
ff53330173
commit
8054f6e5c4
@ -112,7 +112,10 @@ fun ArticleItem(
|
|||||||
this@AnimatedContent,
|
this@AnimatedContent,
|
||||||
resizeMode = SharedTransitionScope.ResizeMode.RemeasureToBounds
|
resizeMode = SharedTransitionScope.ResizeMode.RemeasureToBounds
|
||||||
)
|
)
|
||||||
.background(MaterialTheme.colorScheme.secondaryContainer, MaterialTheme.shapes.small)
|
.background(
|
||||||
|
MaterialTheme.colorScheme.secondaryContainer,
|
||||||
|
MaterialTheme.shapes.small
|
||||||
|
)
|
||||||
.clip(MaterialTheme.shapes.small),
|
.clip(MaterialTheme.shapes.small),
|
||||||
model = article.imageUrl,
|
model = article.imageUrl,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
@ -124,7 +127,8 @@ fun ArticleItem(
|
|||||||
modifier = Modifier.padding(horizontal = 16.dp),
|
modifier = Modifier.padding(horizontal = 16.dp),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(bottom = 24.dp)
|
modifier = Modifier
|
||||||
|
.padding(bottom = 24.dp)
|
||||||
.sharedBounds(
|
.sharedBounds(
|
||||||
rememberSharedContentState("summary"),
|
rememberSharedContentState("summary"),
|
||||||
this@AnimatedContent,
|
this@AnimatedContent,
|
||||||
@ -134,20 +138,23 @@ fun ArticleItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AsyncImage(
|
if (!article.imageUrl.isNullOrEmpty()) {
|
||||||
modifier = Modifier
|
AsyncImage(
|
||||||
.fillMaxWidth()
|
modifier = Modifier
|
||||||
.aspectRatio(16f / 9f)
|
.fillMaxWidth()
|
||||||
.sharedBounds(
|
.aspectRatio(16f / 9f)
|
||||||
rememberSharedContentState("image"),
|
.sharedBounds(
|
||||||
this@AnimatedContent,
|
rememberSharedContentState("image"),
|
||||||
resizeMode = SharedTransitionScope.ResizeMode.RemeasureToBounds
|
this@AnimatedContent,
|
||||||
)
|
resizeMode = SharedTransitionScope.ResizeMode.RemeasureToBounds
|
||||||
.background(MaterialTheme.colorScheme.secondaryContainer),
|
)
|
||||||
model = ImageRequest.Builder(context).data(article.imageUrl).crossfade(false).build(),
|
.background(MaterialTheme.colorScheme.secondaryContainer),
|
||||||
contentScale = ContentScale.Crop,
|
model = ImageRequest.Builder(context).data(article.imageUrl)
|
||||||
contentDescription = null
|
.crossfade(false).build(),
|
||||||
)
|
contentScale = ContentScale.Crop,
|
||||||
|
contentDescription = null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(
|
modifier = Modifier.padding(
|
||||||
@ -186,7 +193,8 @@ fun ArticleItem(
|
|||||||
color = MaterialTheme.colorScheme.secondary
|
color = MaterialTheme.colorScheme.secondary
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(vertical = 16.dp)
|
modifier = Modifier
|
||||||
|
.padding(vertical = 16.dp)
|
||||||
.sharedBounds(
|
.sharedBounds(
|
||||||
rememberSharedContentState("summary"),
|
rememberSharedContentState("summary"),
|
||||||
this@AnimatedContent,
|
this@AnimatedContent,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user