I'm making my application multiplatform so it'll r...
# compose
z
I'm making my application multiplatform so it'll run on desktop and Android and iOS if I ever can. On Android Im gonna support mobile, wear and tv. I'm wondering how to approach these different form factors. There's the material3 window size classes but that's Android only. There's also BoxWithConstraints but that's not as elegant. I wanna try to reuse components as much as I can to keep a consistent UI but also allow them to adjust to the available space
j
If its window size you want then you can just make an expect function to get it. On desktop, use the window size function, on android use the android function, I have code for android and desktop that I can share later to get you started... Also try using flow rows and flow columns and other variable design parts to create a UI that can more or less work on all screens if possible so you dont need to check screen size when possible.
m
I wanna try to reuse components as much as I can
Within the mobile platforms, that seems reasonable. Once you venture beyond that, interaction models differ (e.g., D-pad remote for TV, keyboard+mouse for desktop), which may require different composables and/or screen structures.