Hi guys , anyone who would know what I'm doing wro...
# compose
j
Hi guys , anyone who would know what I'm doing wrong ? Having a ConstraintLayout inside Row, where the Row is using
.height(IntrinsicSize.Max)
is somehow breaking the ConstraintLayout width and I don't follow why...
having following code sample
Copy code
@Composable
fun Sample() {
    Box(
        modifier = Modifier
            .fillMaxSize()
            .background(Color.Red.copy(alpha = 0.15f))
    ) {
        Row(
            verticalAlignment = Alignment.CenterVertically,
            modifier = Modifier
                .height(IntrinsicSize.Max)
                .fillMaxWidth()
                .background(Color.Black)
        ) {
            ConstraintLayout(
                modifier = Modifier
                    .background(Color.Red)
                    .weight(1f)
                    .fillMaxWidth()
                    .background(Color.Yellow)
            ) {
                val (ref1, ref3) = createRefs()
                //createHorizontalChain(ref1, ref3)
                Text("Start", modifier = Modifier.constrainAs(ref1) {
                    start.linkTo(parent.start)
                })

                Text("End", modifier = Modifier.constrainAs(ref3) {
                    end.linkTo(parent.end)
                })
            }

            Box(
                modifier = Modifier
                    .size(64.dp)
                    .background(Color.Cyan)
            )
        }
    }
}
gives me this
if I remove the
.height(IntrinsicSize.Max)
from Row modifier... I'm getting what I do expect
though for my usecase I need to use the modifier for Intrinsic.Max