caelum19
08/07/2020, 2:51 PMsetContent {
ConstraintLayout(modifier = Modifier.fillMaxSize()) {
val d = createRef()
ScrollableColumn(modifier = Modifier.constrainAs(d) {
top.linkTo(<http://parent.top|parent.top>, 30.dp)
bottom.linkTo(parent.bottom, 30.dp)
width = Dimension.value(360.0.dp)
height = Dimension.fillToConstraints
}) {
for (i in 0..30) {
Box(
Modifier.size(135.dp, 60.dp).background(Color.Red)
.drawBorder(1.dp, Color.Black)
) {
// Text("scrrt scrrt")
for (i2 in 0..40 step 2)
Box(
Modifier.size((135 - i2).dp, (60 - i2).dp).background(Color.Red)
.drawBorder(1.dp, Color.Black)
) {
}
}
}
}
}
}
Uncomment // Text("scrrt scrrt") and scrolling is pretty stuttery (even without the many cascading boxes)
But with text, and height = Dimension.value(600.dp), the lag is gone. Without the ConstraintLayout there is also no lag.
Am I doing something silly? I'll create an issue if I'm not 🙂
Using dev 16, though was equally an issue in 15 that I've just potentially isolatedAdam Powell
08/07/2020, 3:17 PMcaelum19
08/07/2020, 5:13 PM