mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-20 01:05: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,
|
supportingText: String? = null,
|
||||||
switchState: Boolean,
|
switchState: Boolean,
|
||||||
onSwitchChange: (Boolean) -> Unit
|
onSwitchChange: (Boolean) -> Unit
|
||||||
) {
|
) = UnittoListItem(
|
||||||
UnittoListItem(
|
modifier = modifier
|
||||||
modifier = Modifier
|
.clickable(
|
||||||
.clickable(
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
indication = rememberRipple(),
|
||||||
indication = rememberRipple(),
|
onClick = { onSwitchChange(!switchState) }
|
||||||
onClick = { onSwitchChange(!switchState) }
|
),
|
||||||
),
|
headlineText = headlineText,
|
||||||
headlineText = headlineText,
|
supportingText = supportingText,
|
||||||
supportingText = supportingText,
|
icon = icon,
|
||||||
icon = icon,
|
iconDescription = iconDescription,
|
||||||
iconDescription = iconDescription,
|
trailing = {
|
||||||
trailing = {
|
Switch(
|
||||||
Switch(
|
checked = switchState,
|
||||||
checked = switchState,
|
onCheckedChange = { onSwitchChange(it) }
|
||||||
onCheckedChange = { onSwitchChange(it) }
|
)
|
||||||
)
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ProvideTextStyle(
|
private fun ProvideTextStyle(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user