-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop Support ? #521
Comments
Currently, major functionality implementation in sora-editor is platform-dependent:
So we are unable to migrate sora-editor to a Kotlin Multiplatform application quickly. However, we are planning to extract the common part of code editor and make a code editor library with Jetpack Compose to finally achieve the multiplatform goal. |
1 - Jetpack compose uses skia for rendering actually, so you can use skia using Jetpack Compose I want you to know that when using Kotlin Multiplatform, The platform dependent API's for example function calls can be made like
expect fun platformAdd(x : Int, y : Int) : Int
actual fun platformAdd(x : Int, y : Int) {
// you can use android api's here with IDE support
return x + y;
// but note that context is not part of common code, so having a context parameter is not possible
// by using jetpack compose, you can create composable functions, which allow you to gain context using LocalContext.current
}
actual fun platformAdd(x : Int, y : Int) {
// on jvm or desktop it will minus the thing
return x - y;
} You can also write expect classes so it should be really easy ! |
Since you are already working with Jetpack Compose, I'll recommend that you add multiplatform support from the beginning so you don't use platform dependent API's deep in the code which will cause you to create "big refactors" later when porting to multiplatform |
Actually, the new project haven't started yet... I'm planning to start the new project after code folding is done in sora-editor. And thanks for your advice. The |
I would like Sora Editor to work on desktop, I propose using Kotlin Multiplatform for this....
The text was updated successfully, but these errors were encountered: