https://kotlinlang.org logo
#compose
Title
# compose
w

wintersoldier

08/24/2022, 5:13 AM
Hey all , Can anyone help how to draw a curved dashed line with arrow in compose. (Similar to the below attached image)
r

romainguy

08/24/2022, 5:15 AM
In a DrawScope you can use drawPath() with a dashed path effect
The curve will be a Path with a cubic curve inside
For the arrow one way to do this is get the matrix at the end of tbe path using https://developer.android.com/reference/android/graphics/PathMeasure#getMatrix(float,%20android.graphics.Matrix,%20int)
(use getLength() to get the end of the path)
That'll give you a translation+rotation matrix to position a triangle at the end of the path
w

wintersoldier

08/24/2022, 5:49 AM
Any very similar implementation of my usecase which I can refer.
w

wintersoldier

08/24/2022, 6:02 AM
Already checked its bit confusing for me since I’m very new to canvas
y

Yashwant Gowla

08/24/2022, 6:03 AM
You need to try and experiments.
41 Views