@@ -68,7 +68,6 @@ private fun PreviewCheckableRelayLocationCell(
68
68
}
69
69
}
70
70
71
- @OptIn(ExperimentalFoundationApi ::class )
72
71
@Composable
73
72
fun StatusRelayItemCell (
74
73
item : RelayItem ,
@@ -89,7 +88,12 @@ fun StatusRelayItemCell(
89
88
item = item,
90
89
isSelected = isSelected,
91
90
state = state,
92
- leadingContent = {
91
+ onClick = onClick,
92
+ onLongClick = onLongClick,
93
+ onToggleExpand = onToggleExpand,
94
+ isExpanded = isExpanded,
95
+ depth = depth,
96
+ content = {
93
97
if (isSelected) {
94
98
Icon (imageVector = Icons .Default .Check , contentDescription = null )
95
99
} else {
@@ -111,11 +115,6 @@ fun StatusRelayItemCell(
111
115
)
112
116
}
113
117
},
114
- onClick = onClick,
115
- onLongClick = onLongClick,
116
- onToggleExpand = onToggleExpand,
117
- isExpanded = isExpanded,
118
- depth = depth,
119
118
)
120
119
}
121
120
@@ -126,12 +125,12 @@ fun RelayItemCell(
126
125
item : RelayItem ,
127
126
isSelected : Boolean ,
128
127
state : RelayListItemState ? ,
129
- leadingContent : (@Composable RowScope .() -> Unit )? = null,
130
128
onClick : () -> Unit ,
131
129
onLongClick : (() -> Unit )? = null,
132
- onToggleExpand : (( Boolean ) -> Unit ) ,
130
+ onToggleExpand : (Boolean ) -> Unit ,
133
131
isExpanded : Boolean ,
134
132
depth : Int ,
133
+ content : @Composable (RowScope .() -> Unit )? = null,
135
134
) {
136
135
137
136
val leadingContentStartPadding = Dimens .cellStartPadding
@@ -162,8 +161,8 @@ fun RelayItemCell(
162
161
.weight(1f ),
163
162
verticalAlignment = Alignment .CenterVertically ,
164
163
) {
165
- if (leadingContent != null ) {
166
- leadingContent ()
164
+ if (content != null ) {
165
+ content ()
167
166
}
168
167
Name (name = item.name, state = state)
169
168
}
@@ -194,16 +193,16 @@ fun CheckableRelayLocationCell(
194
193
item = item,
195
194
isSelected = false ,
196
195
state = null ,
197
- leadingContent = {
196
+ onClick = { onRelayCheckedChange(! checked) },
197
+ onToggleExpand = onExpand,
198
+ isExpanded = expanded,
199
+ depth = depth,
200
+ content = {
198
201
MullvadCheckbox (
199
202
checked = checked,
200
203
onCheckedChange = { isChecked -> onRelayCheckedChange(isChecked) },
201
204
)
202
205
},
203
- onClick = { onRelayCheckedChange(! checked) },
204
- onToggleExpand = onExpand,
205
- isExpanded = expanded,
206
- depth = depth,
207
206
)
208
207
}
209
208
0 commit comments