Thread
#compose
    Yuri Drigin

    Yuri Drigin

    1 year ago
    Hi folks! I need to set priority (content resistance) to item in
    Row
    but cannot figure out how to do it. For sample I have few texts in Row, but I need truncate the first one for sample, not the last
    weight
    isn’t correct way to do it Thanks
    Adam Powell

    Adam Powell

    1 year ago
    are you avoiding weight because you don't want it to fill the full available space or for some other reason?
    Yuri Drigin

    Yuri Drigin

    1 year ago
    weight don’t do it as I need. At least for text.
    Adam Powell

    Adam Powell

    1 year ago
    how so? I ask because people don't always find the
    fill
    optional parameter to
    weight
    , and setting it to
    false
    avoids filling the whole space but it does lower the element's measurement priority so that other siblings measure first.
    Yuri Drigin

    Yuri Drigin

    1 year ago
    Row(
        modifier = Modifier.fillMaxWidth(),
        horizontalArrangement = Arrangement.spacedBy(8.dp)
    ) {
        Text(
            text = walletName,
            style = MaterialTheme.typography.body1,
            maxLines = 1,
            overflow = TextOverflow.Ellipsis,
        )
        Text(
            text = amount,
            modifier = Modifier
                .weight(1f, fill = true),
            style = FormularMonoTypography.body2,
            maxLines = 1,
        )
    }
    May be I wrong but it’s not as priority.
    Adam Powell

    Adam Powell

    1 year ago
    set weight on the lower priority item - the
    walletName
    text.
    Yuri Drigin

    Yuri Drigin

    1 year ago
    +
    from amount - only first symbol
    Adam Powell

    Adam Powell

    1 year ago
    unweighted children measure first
    Yuri Drigin

    Yuri Drigin

    1 year ago
    Yep. It need to truncated walletName if space not enough
    So you offer to put
    Modifier.weight(1f, fill = false)
    on the walletName?
    Let me check
    @Adam Powell Thanks a lot. It help. You right. I didn’t consider
    fill = false
    yearly