Won't we get some context into each composable fun...
# compose
m
Won't we get some context into each composable function? Current
View
has
Context
which allows to load resources (strings, images), read configuration or even get
Application
object. Now I wonder if similar context may be there automatically, or we must pass it ourselves as paramater?
m
Interesting. Thanks!
l
nw πŸ™‚
a
We'll probably have a nicer effect than the raw ambient for doing this, one that will automatically trigger recomposition on a config change when appropriate
m
Config change will restart Activity as usual, so why another check in compose?
a
Because ideally fully compose apps will disable activity recreation because it's not necessary
Activity recreation is a super coarse recompose and it's redundant if your whole UI is already using compose
πŸ’– 2
β™₯️ 4
❀️ 4
πŸ’― 9
πŸ’š 3
πŸ’™ 3
πŸ’› 3
🍻 3
😍 5
πŸ’œ 3
πŸ’ 3
πŸ–€ 3
πŸ’— 3
k
I can't give enough like for this Adam πŸ˜„
l
You can use all the love emoji
πŸ˜‚ 1
See? There’s tone of them
m
But we will have to mark in manifest lots of config changes flags for each activity, or will it work somehow automatically to avoid activity restarts for example when screen rotates?
k
maybe the ComposeActivity can set this up automaticly πŸ€” take a look at the ComposeActivity annotation idea: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1565132788112000?thread_ts=1565101902.109300
☝️ 3
a
Exactly
l
πŸ”
l
my idea was to have
@Composable fun main()
be the entry point πŸ™‚
πŸ˜‚ 4
p
Not again @Leland Richardson [G]
l
DO IT
a
the difficulty with
main
being magic for android is that it maps poorly to multiple activity entry points to an app, which isn't something I want to discourage with the shape of our preferred entry point definition mechanism
l
no multiple activity with compose 🧌
a
can't nicely put more than one at the top level in a file, not much of a place to define the intent filters, etc. etc.
you still want multiple activity for viewers that start on top of other apps, for example
l
Sure, was kidding πŸ™‚
a
posting it mostly for the benefit of onlookers πŸ™‚
πŸ‘πŸΌ 1
l
yeah to be clear i was actually thinking the main() thing for a different usage, and thought it was cute. not actually thinking we should do this. it doesn’t map to the platform well enough