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

Commit d9808bf4 authored by tom hsu's avatar tom hsu Committed by Tom Hsu
Browse files

[SPA] Make bottom corner of last item in lazyCategory be round.

Flag: EXEMPT bug fix
Fix: b/405246886
Test: Visual test, see b/405246886#9
Test: make pass
Test: atest CategoryTest
Change-Id: Ia391110a44b1e5320bdf36ac3e9ba2f11438d4f0
parent 7df8a23d
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 =
@@ -143,7 +145,8 @@ fun LazyCategory(
    header: @Composable () -> Unit,
) {
    Column(
        Modifier.padding(
        Modifier
            .padding(
                PaddingValues(
                    start = SettingsDimension.paddingLarge,
                    end = SettingsDimension.paddingLarge,
@@ -162,8 +165,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() } }
        }