Chris Johnson
08/26/2021, 5:25 PMView.performClick
pepos
08/26/2021, 5:32 PMselected
boolean property of the radio button when row is selectedChris Johnson
08/26/2021, 5:33 PMhfhbd
08/26/2021, 5:51 PMModifier.selectableGroup()
Alexandre Elias [G]
08/26/2021, 5:55 PMChris Johnson
08/26/2021, 8:01 PMpepos
08/26/2021, 8:02 PMChris Johnson
08/26/2021, 8:08 PMConstraintLayout(modifier = Modifier
.fillMaxWidth()
.selectable(
selected = uiState.selected,
onClick = { optionSelected(uiState.id) },
role = Role.RadioButton
)
.clickable(onClick = {
optionSelected(uiState.id)
}, interactionSource = remember { MutableInteractionSource() }, indication = null)
.padding(vertical = spacing_large)) {
val (title, details, radioButton) = createRefs()
Text(text = uiState.text, style = typography.body1, modifier = Modifier.constrainAs(title) {
start.linkTo(parent.start)
top.linkTo(<http://parent.top|parent.top>)
})
if (uiState.details.isNotEmpty()) {
Text(text = uiState.details, style = typography.body2, color = ColorHere, modifier = Modifier.constrainAs(details) {
start.linkTo(parent.start)
top.linkTo(title.bottom)
})
}
RadioButton(selected = uiState.selected, onClick = null, modifier = Modifier.constrainAs(radioButton) {
end.linkTo(parent.end)
top.linkTo(<http://parent.top|parent.top>)
}, colors = RadioButtonDefaults.colors(selectedColor = ColorHere))
Rick Regan
08/26/2021, 8:14 PMChris Johnson
08/26/2021, 8:18 PMModifier.selectableGroup()
was something that would but that fell flatChris Johnson
08/26/2021, 8:21 PMChris Johnson
08/26/2021, 9:03 PMAlexandre Elias [G]
08/26/2021, 9:37 PMModifier.selectable
implicitly contains an indication (pulled from LocalIndication.current
) , which shows the ripple originating from a click on the entire Row. if you are setting a custom indication/interactionSource on the RadioButton itself, perhaps the solution is to move it up one levelAlexandre Elias [G]
08/26/2021, 9:38 PMAlexandre Elias [G]
08/26/2021, 9:41 PMRick Regan
08/26/2021, 9:45 PMChris Johnson
08/26/2021, 9:47 PMChris Johnson
08/26/2021, 9:48 PMChris Johnson
08/26/2021, 9:53 PMAlexandre Elias [G]
08/26/2021, 10:44 PMAlexandre Elias [G]
08/26/2021, 10:45 PMChris Johnson
08/26/2021, 11:27 PMpepos
08/27/2021, 1:52 AMSo you would recommend setting a ripple indication on the row itself in the above scenario ^ and then just letting the radioButton be selectable?for me this would be the expected behavior