Composable Function

RemoteSplitSwitchButton

The Wear Material RemoteSplitSwitchButton offers two slots and shows the current toggle state via a switch.

RemoteSplitSwitchButtonSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteSplitSwitchButtonSample(modifier: RemoteModifier = RemoteModifier) {
    val checked = remember { MutableRemoteBoolean(true) }

    RemoteSplitSwitchButton(
        checked = checked,
        onCheckedChange = valueChangeAction(checked, !checked),
        toggleContentDescription = "Split Switch".rs,
        onContainerClick = valueChangeAction(checked, !checked),
        modifier = modifier,
        label = { RemoteText("Split Switch".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: