Skip to content

Instantly share code, notes, and snippets.

@denis-ismailaj
Created May 20, 2021 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denis-ismailaj/f79a5842c8ee4a37a22dd6112e5aeac5 to your computer and use it in GitHub Desktop.
Save denis-ismailaj/f79a5842c8ee4a37a22dd6112e5aeac5 to your computer and use it in GitHub Desktop.
LabelledRadioButton
@Composable
fun LabelledRadioButton(
selected: Boolean,
onClick: () -> Unit,
label: String,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.clip(MaterialTheme.shapes.small)
.clickable(
indication = rememberRipple(color = MaterialTheme.colors.primary),
interactionSource = remember { MutableInteractionSource() },
onClick = onClick
)
.requiredHeight(ButtonDefaults.MinHeight)
.padding(4.dp)
) {
RadioButton(
selected = selected,
onClick = null
)
Spacer(Modifier.size(8.dp))
Text(
text = label,
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment