Skip to content

Commit 768acfb

Browse files
committed
PR feedback
1 parent 608e07a commit 768acfb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

feature/settings/src/commonMain/kotlin/com/tunjid/heron/settings/ui/SettingsItemRow.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import androidx.compose.foundation.layout.Spacer
3434
import androidx.compose.foundation.layout.fillMaxWidth
3535
import androidx.compose.foundation.layout.padding
3636
import androidx.compose.foundation.layout.width
37+
import androidx.compose.foundation.selection.toggleable
3738
import androidx.compose.foundation.shape.RoundedCornerShape
3839
import androidx.compose.material.icons.Icons
3940
import androidx.compose.material.icons.filled.ExpandLess
@@ -52,6 +53,7 @@ import androidx.compose.ui.draw.clip
5253
import androidx.compose.ui.graphics.Color
5354
import androidx.compose.ui.graphics.graphicsLayer
5455
import androidx.compose.ui.graphics.vector.ImageVector
56+
import androidx.compose.ui.semantics.Role
5557
import androidx.compose.ui.semantics.contentDescription
5658
import androidx.compose.ui.semantics.semantics
5759
import androidx.compose.ui.unit.IntSize
@@ -180,7 +182,12 @@ fun SettingsToggleItem(
180182
modifier = SettingsItemClipModifier
181183
.then(
182184
modifier
183-
.clickable { onCheckedChange(!checked) }
185+
.toggleable(
186+
value = checked,
187+
onValueChange = onCheckedChange,
188+
enabled = enabled,
189+
role = Role.Switch,
190+
)
184191
.padding(
185192
horizontal = 8.dp,
186193
vertical = 4.dp,
@@ -201,7 +208,7 @@ fun SettingsToggleItem(
201208
Switch(
202209
enabled = enabled,
203210
checked = checked,
204-
onCheckedChange = onCheckedChange,
211+
onCheckedChange = null,
205212
)
206213
}
207214
}

0 commit comments

Comments
 (0)