https://kotlinlang.org logo
#compose
Title
# compose
r

romainguy

10/31/2019, 2:13 PM
Jetnews is mostly a showcase for widgets, not an example of how to architecture and app (see navigation for instance)
✔️ 2
🙄 1
m

Michal Bacik

10/31/2019, 7:49 PM
Jetnews could follow best practices suggested by yourself. While trying to achieve this, maybe you realize how easy or hard it will be for developers to provide data downstream to compose widgets. Now I try to make mental model how it may work, and it seems that top-level widget (like your JetnewsApp) needs lots of "state" data to work with (if I want to avoid globals), some of which will be sent downstream, while more specialized widgets will need its specialized data (e.g. list of items to show). I consider if I can pass the data as parameter or receiver. You could really get into position of a developer and think out how these widget will receive working data, and also present this in main sample app. But no globals please if UI widgets are to be reusable 😉
r

romainguy

10/31/2019, 8:25 PM
See my next reply. It should be cleaned up.
2 Views