mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 16:55:26 +02:00
Use modifier from parameter in UnittoListItem with switch
This commit is contained in:
parent
dc2e4af77b
commit
4cfd876bfd
@ -126,26 +126,24 @@ fun UnittoListItem(
|
||||
supportingText: String? = null,
|
||||
switchState: Boolean,
|
||||
onSwitchChange: (Boolean) -> Unit
|
||||
) {
|
||||
UnittoListItem(
|
||||
modifier = Modifier
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = rememberRipple(),
|
||||
onClick = { onSwitchChange(!switchState) }
|
||||
),
|
||||
headlineText = headlineText,
|
||||
supportingText = supportingText,
|
||||
icon = icon,
|
||||
iconDescription = iconDescription,
|
||||
trailing = {
|
||||
Switch(
|
||||
checked = switchState,
|
||||
onCheckedChange = { onSwitchChange(it) }
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
) = UnittoListItem(
|
||||
modifier = modifier
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = rememberRipple(),
|
||||
onClick = { onSwitchChange(!switchState) }
|
||||
),
|
||||
headlineText = headlineText,
|
||||
supportingText = supportingText,
|
||||
icon = icon,
|
||||
iconDescription = iconDescription,
|
||||
trailing = {
|
||||
Switch(
|
||||
checked = switchState,
|
||||
onCheckedChange = { onSwitchChange(it) }
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
@Composable
|
||||
private fun ProvideTextStyle(
|
||||
|
Loading…
x
Reference in New Issue
Block a user