Ilias Zosimadis

    Ilias Zosimadis

    1 year ago
    The problem with intrinsic size is that currently is not supported for SubcomposeLayout. So is there any other way to match the height of the Divider with the ComposableX?
    a

    Alex Bieliaiev

    1 year ago
    My guess is that ConstraintLayout might help in that situation
    You might try to link Divider's top and bottom anchors to the top and bottom of ComposableX
    Ilias Zosimadis

    Ilias Zosimadis

    1 year ago
    I believe that this only centers the divider around the ComposambleX, keeping the size fixed. What I want is to find the height of the parent before the divider's composition. Also, the row is inside a
    lazyColumn
    which measures each child with infinite max height constrain (because it allows a child to be as big as it wants) meaning that you can't just apply
    fillMaxHeight
    modifier.
    Jan Bína

    Jan Bína

    1 year ago
    Well, the ConstraintLayout is definitely an option, you would use
    height = Dimension.fillToConstraints
    in your
    constrainAs
    block so it's not only centered. If your usecase is really that simple, I would just use modifier for
    ComposableX
    , something like this:
    Modifier.drawBehind {
        drawLine(
            color = Color.Black,
            start = Offset(0F, 0F),
            end = Offset(0F, size.height),
            strokeWidth = 1.dp.toPx()
        )
    }
    Ilias Zosimadis

    Ilias Zosimadis

    1 year ago
    Yeah my bad, I forgot about the
    fillToConstraints
    . I also found a solution using a
    SubcomposeLayout
    which can be used to measure the size of a child composable and use it on the composition of a second child. I guess the ContraintLayout is the best solution but I am not sure yet. My use case is not just a Divider and a Composable so I can't use the
    drawBehind
    modifier.