Markus Fung
09/29/2022, 2:01 AManimateDpAsState
to make the animation and it works
however the offset seems a little bit off the place when going to the last circle cell. When i zooming in the preview, i saw these layout indicator line.Markus Fung
09/29/2022, 2:01 AMChris Sinco [G]
09/29/2022, 5:38 AMChris Sinco [G]
09/29/2022, 5:40 AMMarkus Fung
09/29/2022, 6:15 AMMarkus Fung
09/29/2022, 6:15 AMColumn {
Row {
Rectangle()
}
}
like thisMarkus Fung
09/29/2022, 7:11 AMBox(modifier = Modifier
.offset(x = offsetXState.value.dp, y = offsetYState.value.dp)
.size(cellSize.dp)
.aspectRatio(1f)
.background(Color(0xFFf75f57))
)
Markus Fung
09/29/2022, 7:11 AMoffset
Markus Fung
09/29/2022, 7:11 AMDoris Liu
09/30/2022, 7:24 PMfun Modifier.offset(offset: Density.() -> IntOffset)
API instead? I'd recommend this API for animations since it avoids recomposition on every frame which is more efficient