← Back to Wear Material
TitleCard
Component
in
Wear Material
. Since 1.0.0Overview
Examples
Community Notes
Video
@Composable
fun TitleCardStandard() {
TitleCard(
onClick = {},
title = { Text("TitleCard") },
time = { Text("now") },
) {
Text("Some body content")
Text("and some more body content")
}
}
@Composable
fun TitleCardWithImage() {
TitleCard(
onClick = { /* Do something */ },
title = { Text("TitleCard With an ImageBackground") },
backgroundPainter = CardDefaults.imageWithScrimBackgroundPainter(
backgroundImagePainter = painterResource(id = R.drawable.backgroundimage)
),
contentColor = MaterialTheme.colors.onSurface,
titleColor = MaterialTheme.colors.onSurface,
) {
Text("Text coloured to stand out on the image")
}
}
Previous Component← TimeText
Next ComponentToggleButton →