I am using Yandex MapKit. I can draw routes(polylines) but how can I animate it like this? - https://yandex.ru/dev/maps/jsbox/2.1/polyline_animation
i tried to do it through ValueAnimator. It worked for my task
private fun displayRoute(pointsList: List<Point>) {
val valueAnimator = ValueAnimator.ofInt(1, pointsList.size)
valueAnimator.duration = 1200
valueAnimator.addUpdateListener {
val polylineMapObject = binding?.mapViewOrderDetail?.map?.mapObjects?.addPolyline(
Polyline(pointsList.subList(0, it.animatedValue as Int))
)
polylineMapObject?.strokeColor = ContextCompat.getColor(requireActivity(), R.color.color_black)
}
valueAnimator.start()
}