Composable Function

RemoteSwitchButton

The Wear Material RemoteSwitchButton offers four slots and a specific layout for an icon, a label, a secondaryLabel and a switch toggle control.

RemoteSwitchButtonSample

@Sampled
@RemoteComposable
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
public fun RemoteSwitchButtonSample(modifier: RemoteModifier = RemoteModifier) {
    val checked = rememberMutableRemoteBoolean(true)

    RemoteSwitchButton(
        checked = checked,
        onCheckedChange = valueChange(checked, !checked),
        modifier = modifier,
        label = { RemoteText("Switch".rs) },
    )
}

Content updated: