Does anybody here have experience sharing code bet...
# compose
t
Does anybody here have experience sharing code between Android and AndroidTV when using compose? I'm honestly not sure how this should work given that both platforms have their own versions of the material dependency (and TV has an additional foundation dependency). Even if we can somehow make the dependencies work there's also focus management to consider. Has anybody found any elegant ways to make sure TV platforms can have their own focus management code without cluttering the Android components too much?
2
i
I think you'll find that the UI patterns of phones, TV, and Wear devices are purposefully quite different and will require their own custom UIs built with the specific libraries built for those purposes. Better to share your lower layers (e.g., a repository layer) rather than cram a round peg in a square hole
t
Thank you for your answer! I was hoping to at least be able to share some static elements that don't have any interaction, but now that I think about it, there aren't really a lot of elements in our design that would have been a good fit for sharing between the two platforms. In our current view-based implementation we share a few components but in hindsight I'm not sure if doing that was actually a good idea.