mattinger
01/13/2022, 10:04 PMRow(
modifier = modifier.selectable(
selected = selected,
onClick = onClick,
enabled = enabled,
role = role,
interactionSource = interactionSource,
indication = LocalIndication.current
),
verticalAlignment = Alignment.CenterVertically
) {
// Text and Radio Button
}
Zach Klippenstein (he/him) [MOD]
01/13/2022, 10:32 PMModifer.semantics(mergeDescendents=true)
Colton Idle
01/13/2022, 10:36 PMmattinger
01/13/2022, 11:53 PMPrinting with useUnmergedTree = 'false'
Node #1 at (l=0.0, t=56.0, r=41.0, b=93.0)px
|-Node #2 at (l=0.0, t=56.0, r=41.0, b=93.0)px
Role = 'RadioButton'
Selected = 'false'
Text = '[Label]'
Actions = [OnClick, GetTextLayoutResult]
MergeDescendants = 'true'
|-Node #5 at (l=0.0, t=61.0, r=28.0, b=89.0)px, Tag: 'button1'
Tone = 'Neutral'
Role = 'RadioButton'
Selected = 'false'
Actions = [OnClick]
MergeDescendants = 'true'
genericClickableWithoutGesture
when you use .selectableZach Klippenstein (he/him) [MOD]
01/14/2022, 12:25 AMAlbert Chang
01/14/2022, 12:48 AMonClick
parameter of RadioButton
? If so, try setting it to null.mattinger
01/14/2022, 1:20 AMColton Idle
01/14/2022, 1:26 AMmattinger
01/14/2022, 1:27 AMColton Idle
01/14/2022, 1:28 AMmattinger
01/14/2022, 1:29 AMColton Idle
01/14/2022, 1:33 AMmattinger
01/14/2022, 1:44 AM@Composable
fun TriStateCheckbox(
state: ToggleableState,
onClick: (() -> Unit)?,
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
colors: CheckboxColors = CheckboxDefaults.colors()
)
Modifier.selectable(
selected = selected,
onClick = onClick,
enabled = enabled,
role = Role.RadioButton,
interactionSource = interactionSource,
indication = rememberRipple(
bounded = false,
radius = RadioButtonRippleRadius
)
)
Albert Chang
01/14/2022, 2:15 AMmattinger
01/14/2022, 2:25 AMAnastasia [G]
01/14/2022, 3:00 PMnull
is right, this is exactly why we made the callback nullable.
We keep https://issuetracker.google.com/issues/193414941 open to improve the API reference documentation, maybe a sample of this use case closer to the RadioButton
documentation itself would helpmattinger
01/15/2022, 12:10 AM