Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc45b428 authored by Tom Hsu's avatar Tom Hsu Committed by Android (Google) Code Review
Browse files

Merge "[Expressive UI] Make top item in Category corner be round except header." into main

parents 27c41e49 82d429f6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ object SettingsShape {

    val CornerExtraLarge1 = RoundedCornerShape(40.dp)

    val TopCornerMedium2 =
        RoundedCornerShape(CornerSize(20.dp), CornerSize(20.dp), CornerSize(0), CornerSize(0))

    val BottomCornerMedium2 =
        RoundedCornerShape(CornerSize(0), CornerSize(0), CornerSize(20.dp), CornerSize(20.dp))
}
+16 −5
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@ fun LazyCategory(
    footer: @Composable () -> Unit = {},
    header: @Composable () -> Unit,
) {
    header()
    Column(
        Modifier
            .padding(
@@ -162,15 +161,27 @@ fun LazyCategory(
            verticalArrangement = Arrangement.spacedBy(SettingsDimension.paddingTiny),
            state = state,
        ) {
            item { CompositionLocalProvider(LocalIsInCategory provides false) { header() } }

            items(count = list.size, key = key) {
                title?.invoke(it)?.let { title -> CategoryTitle(title) }
                if (list.isNotEmpty() && it < list.size - 1) {
                when (it) {
                    0 -> {
                        Column(modifier = Modifier.clip(SettingsShape.TopCornerMedium2)) {
                            CompositionLocalProvider(LocalIsInCategory provides true) { entry(it)() }
                } else {
                        }
                    }

                    list.size - 1 -> {
                        Column(modifier = Modifier.clip(SettingsShape.BottomCornerMedium2)) {
                            CompositionLocalProvider(LocalIsInCategory provides true) { entry(it)() }
                        }
                    }

                    else -> {
                        CompositionLocalProvider(LocalIsInCategory provides true) { entry(it)() }
                    }
                }
            }

            item { CompositionLocalProvider(LocalIsInCategory provides true) { footer() } }