I'm looking for opinions on an architectural decis...
# compose
j
I'm looking for opinions on an architectural decision for a brand new project I'm starting, with probably around 20 different screens for the user to go to I need to decide between the following: 1. Single activity, many Composables 2. Single activity, one fragment per "screen", many Composables 3. Many activities, no fragments, many Composables I'm leaning toward option 3, but I'm wondering if option 3 will make it hard to have shared element transitions between different Activities? all opinions welcome 🙏
e
I think option 1 would be the best choice since you can use Compose Navigation to handle navigating in Compose and compose-shared-element to do transitions. If you have a solid use case for having lots of activities, maybe deep linking or external intents, then option 3 might be better. Tho even deep linking can be handled in a single activity…
🙏 1
s
I would never go with 3 1 is the more "bleeding edge" approach, which will have you rely on accompanist for stuff like animations between screens etc. I would go there if you like being adventurous and don't mind spending some extra time figuring out stuff. 2 is the most battle tested way, navigation for fragments has been there for a long time, navigation animations are not relying on accompanist. Plus when you feel ready, to replace all the top level fragments with just composables will be a breeze. As long as all your fragments do is inflate their composable.
🙏 1
c
Option 1 hasn't failed me yet in 3 apps in prod. Also, shared element transitions are coming soon it seems
🙏 1
z
I would do 1 as well. Gives you much more flexibility with how you handle navigation, and since it's all in compose it's probably going to be easier to test
🙏 2
m
I would pick 2. I like the 1) but for me there is no viable navigation library full compose yet
🙏 1
j
amazing, thank you all for the responses 💙
🙏 1
a
We do option 1, also has view embedded by AndroidView composable