@@ -68,6 +68,7 @@ import com.artemchep.keyguard.feature.home.vault.component.localSurfaceColorAtEl
68
68
import com.artemchep.keyguard.feature.home.vault.component.surfaceColorAtElevationSemi
69
69
import com.artemchep.keyguard.feature.home.vault.model.VaultItemIcon
70
70
import com.artemchep.keyguard.ui.surface.LocalSurfaceColor
71
+ import com.artemchep.keyguard.ui.surface.ProvideSurfaceColor
71
72
import com.artemchep.keyguard.ui.theme.combineAlpha
72
73
import kotlinx.collections.immutable.PersistentList
73
74
import kotlinx.collections.immutable.toPersistentList
@@ -416,6 +417,10 @@ fun FlatItemLayout(
416
417
contentPadding : PaddingValues = defaultContentPadding,
417
418
elevation : Dp = 0.dp,
418
419
backgroundColor : Color = Color .Unspecified ,
420
+ contentColor : Color = backgroundColor
421
+ .takeIf { it.isSpecified }
422
+ ?.let { contentColorFor(it) }
423
+ ? : LocalContentColor .current,
419
424
content : @Composable ColumnScope .() -> Unit ,
420
425
actions : List <FlatItemAction > = emptyList(),
421
426
leading : (@Composable RowScope .() -> Unit )? = null,
@@ -424,10 +429,11 @@ fun FlatItemLayout(
424
429
onLongClick : (() -> Unit )? = null,
425
430
enabled : Boolean = onClick != null,
426
431
) {
427
- Column (
432
+ ContentColorColumn (
428
433
modifier = modifier
429
434
.fillMaxWidth()
430
435
.padding(paddingValues),
436
+ color = contentColor,
431
437
) {
432
438
val backgroundModifier = kotlin.run {
433
439
// Check if there's actually a background color
@@ -566,6 +572,19 @@ fun FlatItemLayout(
566
572
}
567
573
}
568
574
575
+ @Composable
576
+ private fun ContentColorColumn (
577
+ modifier : Modifier = Modifier ,
578
+ color : Color ,
579
+ content : @Composable ColumnScope .() -> Unit ,
580
+ ) = Column (modifier = modifier) {
581
+ CompositionLocalProvider (
582
+ LocalContentColor provides color,
583
+ ) {
584
+ content()
585
+ }
586
+ }
587
+
569
588
@Composable
570
589
fun RowScope.FlatItemActionContent (
571
590
action : FlatItemAction ,
0 commit comments