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

Commit 8ec5d425 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[SPA] Make bottom corner of last item in lazyCategory be round." into main

parents 735783ee d9808bf4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settingslib.spa.framework.theme

import androidx.compose.foundation.shape.CornerSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.unit.dp

@@ -31,4 +32,7 @@ object SettingsShape {
    val CornerExtraLarge = RoundedCornerShape(28.dp)

    val CornerExtraLarge1 = RoundedCornerShape(40.dp)

    val BottomCornerMedium2 =
        RoundedCornerShape(CornerSize(0), CornerSize(0), CornerSize(20.dp), CornerSize(20.dp))
}
+12 −3
Original line number Diff line number Diff line
@@ -106,7 +106,9 @@ fun Category(
                    }
                    .then(
                        if (isSpaExpressiveEnabled)
                            Modifier.fillMaxWidth().clip(SettingsShape.CornerMedium2)
                            Modifier
                                .fillMaxWidth()
                                .clip(SettingsShape.CornerMedium2)
                        else Modifier
                    ),
            verticalArrangement =
@@ -144,7 +146,8 @@ fun LazyCategory(
) {
    header()
    Column(
        Modifier.padding(
        Modifier
            .padding(
                PaddingValues(
                    start = SettingsDimension.paddingLarge,
                    end = SettingsDimension.paddingLarge,
@@ -161,8 +164,14 @@ fun LazyCategory(
        ) {
            items(count = list.size, key = key) {
                title?.invoke(it)?.let { title -> CategoryTitle(title) }
                if (list.isNotEmpty() && it < list.size - 1) {
                    CompositionLocalProvider(LocalIsInCategory provides true) { entry(it)() }
                } else {
                    Column(modifier = Modifier.clip(SettingsShape.BottomCornerMedium2)) {
                        CompositionLocalProvider(LocalIsInCategory provides true) { entry(it)() }
                    }
                }
            }

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