RemoteCheckboxButton

Functions summary

Unit
@Composable
@RemoteComposable
RemoteCheckboxButton(
    checked: RemoteBoolean,
    onCheckedChange: Action,
    modifier: RemoteModifier,
    enabled: RemoteBoolean,
    shape: RemoteShape,
    colors: RemoteCheckboxButtonColors,
    contentPadding: RemotePaddingValues,
    border: RemoteDp?,
    borderColor: RemoteColor?,
    icon: (@Composable @RemoteComposable () -> Unit)?,
    secondaryLabel: (@Composable @RemoteComposable RemoteRowScope.() -> Unit)?,
    label: @Composable @RemoteComposable RemoteRowScope.() -> Unit
)

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

Functions

@Composable
@RemoteComposable
fun RemoteCheckboxButton(
    checked: RemoteBoolean,
    onCheckedChange: Action,
    modifier: RemoteModifier = RemoteModifier,
    enabled: RemoteBoolean = true.rb,
    shape: RemoteShape = RemoteCheckboxButtonDefaults.checkboxButtonShape,
    colors: RemoteCheckboxButtonColors = RemoteCheckboxButtonDefaults.checkboxButtonColors(),
    contentPadding: RemotePaddingValues = RemoteCheckboxButtonDefaults.ContentPadding,
    border: RemoteDp? = null,
    borderColor: RemoteColor? = null,
    icon: (@Composable @RemoteComposable () -> Unit)? = null,
    secondaryLabel: (@Composable @RemoteComposable RemoteRowScope.() -> Unit)? = null,
    label: @Composable @RemoteComposable RemoteRowScope.() -> Unit
): Unit

The Wear Material RemoteCheckboxButton offers four slots and a specific layout for an icon, a label, a secondaryLabel and a checkbox toggle control. The icon and secondaryLabel are optional. The items are laid out in a row with the optional icon at the start, a column containing the two label slots and a Checkbox at the end.

import androidx.compose.remote.creation.compose.action.valueChange
import androidx.compose.remote.creation.compose.state.rememberMutableRemoteBoolean
import androidx.compose.remote.creation.compose.state.rs
import androidx.wear.compose.remote.material3.RemoteCheckboxButton
import androidx.wear.compose.remote.material3.RemoteText

val checked = rememberMutableRemoteBoolean(true)

RemoteCheckboxButton(
    checked = checked,
    onCheckedChange = valueChange(checked, !checked),
    modifier = modifier,
    label = { RemoteText("Checkbox".rs) },
)
Parameters
checked: RemoteBoolean

Boolean flag indicating whether this button is currently checked.

onCheckedChange: Action

Callback to be invoked when this button is clicked.

modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the button.

enabled: RemoteBoolean = true.rb

Controls the enabled state of the button. When false, this button will not be clickable. Note that only constant values are currently supported for enabled for click handling.

shape: RemoteShape = RemoteCheckboxButtonDefaults.checkboxButtonShape

Defines the button's shape.

colors: RemoteCheckboxButtonColors = RemoteCheckboxButtonDefaults.checkboxButtonColors()

RemoteCheckboxButtonColors that will be used to resolve the colors used for this button in different states.

contentPadding: RemotePaddingValues = RemoteCheckboxButtonDefaults.ContentPadding

The spacing values to apply internally between the container and the content.

border: RemoteDp? = null

Optional RemoteDp border stroke width.

borderColor: RemoteColor? = null

Optional RemoteColor border color.

icon: (@Composable @RemoteComposable () -> Unit)? = null

An optional slot for providing an icon to indicate the purpose of the button.

secondaryLabel: (@Composable @RemoteComposable RemoteRowScope.() -> Unit)? = null

A slot for providing the button's secondary label.

label: @Composable @RemoteComposable RemoteRowScope.() -> Unit

A slot for providing the button's main label.