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

Martin Nowosad

12/10/2020, 8:57 AM
is there currently a way to render/draw your own ui elements / composables (analog to creating a custom view on android and writing your own logic within
onDraw
)?
a

allan.conda

12/10/2020, 8:59 AM
Copy code
Canvas { // DrawScope
   drawPoint(...)
}
there’s no
DrawScope.drawText
yet though
m

Martin Nowosad

12/10/2020, 9:01 AM
thanks for the hint @allan.conda, I can’t find any documentation on the API, do you happen to know where I can find it?
m

Martin Nowosad

12/10/2020, 9:08 AM
that’s what I was looking for, thanks ❤️
I hope that custom composables will be supported by KMMP
would be neat
n

Nader Jawad

12/10/2020, 2:29 PM
There are a few different versions of DrawModifiers that expose a lambda with a DrawScope recevier that you can use to issue drawing calls.
Modifier.drawBehind, Modifier.drawWithContent, Modifier.drawWithCache
are a few examples
z

Zach Klippenstein (he/him) [MOD]

12/10/2020, 6:01 PM
I hope that custom composables will be supported by KMMP
Every composable function you write is a custom composable 😉
👍 1
4 Views