Composable Function

RemoteTitleCard

Opinionated Wear Material 3 RemoteCard that offers a specific layout to show interactive information about an application, e.g.

RemoteTitleCardSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteTitleCardSample() {
    RemoteTitleCard(
        onClick = RemoteAction.Empty,
        title = { RemoteText("Title Card Title".rs) },
        time = { RemoteText("now".rs) },
        modifier = RemoteModifier.padding(16.rdp),
        subtitle = { RemoteText("Card Subtitle here".rs) },
    ) {
        RemoteText("This is a sample Title Card.".rs)
    }
}

RemoteTitleCardWithImageSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteTitleCardWithImageSample() {
    val backgroundImage = remember {
        createNamedRemoteImageBitmap(name = "backgroundImage") {
            createImage(200, 200).asImageBitmap()
        }
    }
    val containerPainter = RemoteCardDefaults.containerPainter(backgroundImage)
    RemoteTitleCard(
        onClick = RemoteAction.Empty,
        containerPainter = containerPainter,
        title = { RemoteText("Title Card".rs) },
        time = { RemoteText("now".rs) },
        modifier = RemoteModifier.padding(16.rdp),
        subtitle = { RemoteText("Card Subtitle".rs) },
    ) {
        RemoteText("Card with background image.".rs)
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: