Can androidx.graphics:graphics-shapes be used on d...
# compose-desktop
c
Can androidx.graphics:graphics-shapes be used on desktop? I want to access the Morph type
i
We don't have any extra adoption on Compose Multplatform/JB fork side, but as I can see it's published by Google with desktop support. So it should work I guess
🤔 1
c
Thanks! I'll try it out
It didn't work in the end 🥲 the
toPath
extension method doesn't exist on desktop 😔
i
Path there is Android platform type. Nor skiko or compose shouldn't be in dependencies there. Also, as I see this function is about a few lines only, so I don't think that it should be a blocker to adopt this piece
c
I think the
asComposePath
also needs to be moved to the common package as well. I'll try copy these functions when I get time
It's in Android and desktop separately
i
Yes, it's because its for different types
No, it shouldn't be in common
c
There should be an expect fun in common, no?
i
To have this expect function, it should be expect typealias type. I don't think that public common typealias for type from skiko library is a good thing
I know that we have something leaking to public, but Compose public API surface, especially common shouldn't expose any skiko things. It's implementation details
For this particular case we need a function to direct transformation to Compose type from that shapes
c
Mhhh. I'm still very new to compose apis. I thought it would work to make it common so people can copy and paste snippets from the android docs...that would be great DX
i
It should work for Compose code, but NOT for platform types.
android.graphics.Path
is part of Android OS SDK, and it should not be in common
androidx.compose.ui.graphics.Path
is a part for Compose, and it should be in common
c
Mhhh...makes sense. Then
toPath
is probably the wrong function to use. Probably something that converts to a composable directly would work?
Like
toComposePath
?
Then internally it converts to the composable for that platform
i
compose shouldn't be in dependencies there
The problem here is that library is not aware of compose. And shouldn't be. And Compose is not aware of that library and shouldn't be. I agree this function should exists, but not sure where exactly yet