From 4cfd876bfd3b4d84a15a6dfa158b22d4d2879c0b Mon Sep 17 00:00:00 2001 From: Sad Ellie Date: Tue, 26 Sep 2023 13:53:53 +0300 Subject: [PATCH] Use modifier from parameter in UnittoListItem with switch --- .../unitto/core/ui/common/UnittoListItem.kt | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/UnittoListItem.kt b/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/UnittoListItem.kt index 7f477bf3..1da7144d 100644 --- a/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/UnittoListItem.kt +++ b/core/ui/src/main/java/com/sadellie/unitto/core/ui/common/UnittoListItem.kt @@ -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(