Steffen Funke
11/10/2021, 4:21 PMSurface to not set any contentColor, e.g. make it behave like a Box in this regard? I have custom colored content (Texts, Sliders, etc….), but as soon as I wrap them into a ModalBottomSheetLayout - which is backed by a Surface - everything gets tinted with the contentColor. I surely miss something here. 🤔Steffen Funke
11/10/2021, 4:21 PM@Composable
fun Surface(
modifier: Modifier = Modifier,
shape: Shape = RectangleShape,
color: Color = MaterialTheme.colors.surface,
contentColor: Color = contentColorFor(color),
border: BorderStroke? = null,
elevation: Dp = 0.dp,
content: @Composable () -> Unit
) {
Surface(
modifier = modifier,
shape = shape,
color = color,
contentColor = contentColor,
border = border,
elevation = elevation,
content = content,
clickAndSemanticsModifier = Modifier
.semantics(mergeDescendants = false) {}
.pointerInput(Unit) { }
)
}Steffen Funke
11/10/2021, 4:23 PMcontentColor to null to have the widgets shown their color. But I guess that is not how it is supposed to work.Luke
11/10/2021, 4:27 PMcontentColor = Color.Transparent would help?Luke
11/10/2021, 4:28 PMColor.UnspecifiedSteffen Funke
11/10/2021, 4:32 PMSteffen Funke
11/10/2021, 4:36 PMcolor (which actually is its backgroundColor) fixes the alpha of the foreground now. Interesting. Thanks for pointing me in the direction @Luke !