Card UI: Display header image

Bug: 216019530
Change-Id: I98acc9951e5644ba5627baa2dc97ca25265b3c2b
pull/2/head
Caren Chang 3 years ago committed by Don Turner
parent 7f69af24a8
commit c417672c85

@ -68,6 +68,12 @@ fun NewsResourceCardExpanded(
Column(
modifier = Modifier.padding(16.dp)
) {
if (!newsResource.headerImageUrl.isNullOrEmpty()) {
Row {
NewsResourceHeaderImage(newsResource.headerImageUrl)
}
Spacer(modifier = Modifier.height(12.dp))
}
Row {
NewsResourceAuthors(newsResource.authors)
}
@ -84,9 +90,17 @@ fun NewsResourceCardExpanded(
@Composable
fun NewsResourceHeaderImage(
newsResource: NewsResource
headerImageUrl: String?
) {
TODO()
AsyncImage(
modifier = Modifier
.fillMaxWidth()
.height(180.dp),
contentScale = ContentScale.Crop,
model = headerImageUrl,
// TODO b/226661685: Investigate using alt text of image to populate content description
contentDescription = null // decorative image
)
}
@Composable

Loading…
Cancel
Save