Skip to content

Commit f85fb36

Browse files
committed
Review: Fix list item rounded corners
1 parent 487ac6f commit f85fb36

51 files changed

Lines changed: 11 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/src/main/java/com/orange/ouds/core/component/OudsListItem.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ internal fun OudsListItem(
261261
}
262262

263263
with(OudsTheme.components.listItem) {
264-
val borderRadius = if (card && LocalThemeSettings.current.roundedCornerCardItems == true) border.radius.rounded else border.radius.default
264+
val borderRadius = borderRadius(card = card, focused = state == OudsListItemState.Focused)
265265
val shape = shape(cornerRadius = borderRadius)
266266

267267
val clickableModifier = if (onClick != null) {
@@ -437,6 +437,16 @@ private fun Modifier.border(state: OudsListItemState, decoration: OudsListItemDe
437437
}
438438
}
439439

440+
@Composable
441+
private fun borderRadius(card: Boolean, focused: Boolean) = with(OudsTheme.components.listItem) {
442+
when {
443+
card && LocalThemeSettings.current.roundedCornerCardItems == true -> border.radius.rounded
444+
card -> border.radius.default
445+
focused -> border.radius.default
446+
else -> 0.dp
447+
}
448+
}
449+
440450
@Composable
441451
private fun shape(cornerRadius: Dp) = RoundedCornerShape(cornerRadius)
442452

-1.21 KB
-1.81 KB
-1.25 KB
-1.1 KB
-1.77 KB
-1.12 KB
-304 Bytes
-458 Bytes
-309 Bytes

0 commit comments

Comments
 (0)