xxfast
08/08/2023, 1:41 AMLazyVerticalGrid(columns = GridCells.Adaptive(256.dp), ..) {
..
item { TransactionDetailItem( label = { .. }, description = { .. }, ) }
item(span = { GridItemSpan(this.maxLineSpan) }) {
TransactionDetailItem(
label = { .. },
description = {
Surface(..) {
Text(
text = raw,
modifier = Modifier
.horizontalScroll(rememberScrollState())
.padding(8.dp),
)
}
},
)
}
}
This works okay for smaller raw payloads, but throws with this exception when the raw text is larger
java.lang.IllegalArgumentException: Can't represent a size of 4660198 in Constraints
Found this issue on the tracker that is relevant i think but was supposedly fixed in foundation 1.3.0-beta02
. But I was able to reproduce this in 1.4.3
.
Am i missing something here? 🤔Albert Chang
08/08/2023, 1:54 PMConstraints uses a Long to represent four values, minWidth, minHeight, maxWidth, and maxHeight. The range of the values varies to allow for at most 256K in one dimension.
Laying out such long text all at once is extremely inperformant and you should split the text anyway.
xxfast
08/09/2023, 12:10 AMAlbert Chang
08/09/2023, 6:41 AM