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

Michal Bacik

10/31/2019, 2:36 PM
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

Michal Bacik

10/31/2019, 2:41 PM
Interesting. Thanks!
l

Luca Nicoletti

10/31/2019, 2:43 PM
nw 🙂
a

Adam Powell

10/31/2019, 3:02 PM
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

Michal Bacik

10/31/2019, 3:06 PM
Config change will restart Activity as usual, so why another check in compose?
a

Adam Powell

10/31/2019, 3:16 PM
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

kioba

10/31/2019, 3:20 PM
I can't give enough like for this Adam 😄
l

Luca Nicoletti

10/31/2019, 3:20 PM
You can use all the love emoji
😂 1
See? There’s tone of them
m

Michal Bacik

10/31/2019, 3:21 PM
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

kioba

10/31/2019, 3:28 PM
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

Adam Powell

10/31/2019, 3:32 PM
Exactly
l

Luca Nicoletti

10/31/2019, 3:32 PM
🔝
l

Leland Richardson [G]

10/31/2019, 4:29 PM
my idea was to have
@Composable fun main()
be the entry point 🙂
😂 4
p

pavi2410

10/31/2019, 4:48 PM
Not again @Leland Richardson [G]
l

Luca Nicoletti

10/31/2019, 4:48 PM
DO IT
a

Adam Powell

10/31/2019, 4:55 PM
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

Luca Nicoletti

10/31/2019, 4:56 PM
no multiple activity with compose 🧌
a

Adam Powell

10/31/2019, 4:56 PM
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

Luca Nicoletti

10/31/2019, 4:57 PM
Sure, was kidding 🙂
a

Adam Powell

10/31/2019, 4:57 PM
posting it mostly for the benefit of onlookers 🙂
👍🏼 1
l

Leland Richardson [G]

10/31/2019, 5:48 PM
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