I trying to animate the changes between points which I have drawn in canvas, check output preview inside thread.
val points: List<Offset> = listOf(
Offset(200f, 200f), Offset(400f, 200f),
Offset(200f, 200f), Offset(200f, 400f),
Offset(400f, 200f), Offset(400f, 400f),
Offset(200f, 400f), Offset(400f, 400f),
Offset(200f, 400f), Offset(200f, 600f),
Offset(200f, 600f), Offset(400f, 600f),
Offset(400f, 400f), Offset(400f, 600f),
)
Two offsets completes a line, this whole points makes ->
8
How I want is, lines must be drawn between those points at certain duration.
Canvas(
modifier = Modifier.fillMaxSize()
) {
drawPoints(
points = points,
pointMode = PointMode.Lines,
color = Color.Gray,
strokeWidth = 16f,
cap = StrokeCap.Round,
pathEffect = PathEffect.dashPathEffect(floatArrayOf(8f, 16f))
)
}