Skip to content

Commit c3427af

Browse files
committed
Fix incorrect shape clipping in article language list
1 parent 255e8b5 commit c3427af

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

app/src/main/java/org/nsh07/wikireader/ui/homeScreen/ArticleLanguageBottomSheet.kt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,14 @@ fun ArticleLanguageBottomSheet(
151151
supportingContent = { Text(it.title) },
152152
modifier = Modifier
153153
.clip(
154-
if (index == 0) topListItemShape
155-
else if (index == articleLangs.first.size - 1) bottomListItemShape
156-
else middleListItemShape
154+
if (articleLangs.first.size == 1) shapes.large
155+
else {
156+
when (index) {
157+
0 -> topListItemShape
158+
articleLangs.first.size - 1 -> bottomListItemShape
159+
else -> middleListItemShape
160+
}
161+
}
157162
)
158163
.clickable(
159164
onClick = {
@@ -201,9 +206,14 @@ fun ArticleLanguageBottomSheet(
201206
supportingContent = { Text(it.title) },
202207
modifier = Modifier
203208
.clip(
204-
if (index == 0) topListItemShape
205-
else if (index == articleLangs.second.size - 1) bottomListItemShape
206-
else middleListItemShape
209+
if (articleLangs.second.size == 1) shapes.large
210+
else {
211+
when (index) {
212+
0 -> topListItemShape
213+
articleLangs.second.size - 1 -> bottomListItemShape
214+
else -> middleListItemShape
215+
}
216+
}
207217
)
208218
.clickable(
209219
onClick = {

0 commit comments

Comments
 (0)