What is your guys' workflow for creating multiplat...
# compose-desktop
f
What is your guys' workflow for creating multiplatform GUIs? Android LiveEdit does not work in multiplatform projects; Neither the desktop or Android Preview mechanism may be used in common code; So it feels like, the only approach is to develop the app for only one platform for fast iterative development, be careful to only use multiplatform APIs, and once you are done make a new multiplatform project and put your code there? I must be missing something.
g
I tend to just click the run button and see the result. Unless your app is absolutely massive, the build time is not long.
If you're working on specifically a UI - feed it dummy data and temporarily have the entry point for your app be that GUI.
k
LiveEdit and Preview might be nice to have, but how are those related to multiplatform development? What kind of guardrails do you see in LiveEdit that would stop you from “dipping” into platform-specific APIs when you’re developing on your machine?
g
That's the other thing is as mentioned above, the UI is almost entirely standardized, the only platform specific stuff you're really doing is (maybe) the data source for local files or something. But even then, I just live in the multiplatform common environment at this point and don't look back.
k
does preview on desktop have similar parameters as android? e.g. sizes etc?
s
I use UI tests to build and test my UI, especially if the app becomes large and I don't want to click through a lot of screens, login, do database stuff, if I just want to test a new UI part. I typically just spin up the particular UI component (sometimes the ViewModel too) in such a UI test.
a
If you support Compose for Desktop, then you can use Preview in common code.
e
No you cannot use preview in common code in any circumstance. You will need to create some empty / preview file in your android OR desktop sourceset and use the preview from there.
a
k
oh wow! ill try this out
K 1
f