Composable Function

RemoteCard

Base level Wear Material 3 RemoteCard that offers a single slot to take any content.

RemoteCardSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteCardSample() {
    RemoteCard(onClick = Action.Empty, modifier = RemoteModifier.padding(16.rdp)) {
        RemoteText("This is a basic card".rs)
    }
}

RemoteCardWithImageSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteCardWithImageSample() {
    val backgroundImage =
        rememberNamedRemoteImageBitmap(name = "backgroundImage") {
            createImage(200, 200).asImageBitmap()
        }
    val containerPainter = RemoteCardDefaults.containerPainter(backgroundImage)
    RemoteCard(
        onClick = Action.Empty,
        containerPainter = containerPainter,
        modifier = RemoteModifier.padding(16.rdp),
    ) {
        RemoteText("Card with image".rs)
    }
}

Content updated: