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

Tristan

06/19/2020, 3:54 AM
Hello, from this tweet https://twitter.com/intelligibabble/status/1273659190406295553?s=21 what is the difference between by mutableStateOf and by state ? It seems that both are mutable on this example :O
l

Leland Richardson [G]

06/19/2020, 4:00 AM
state { 123 }
is equivalent to
remember { mutableStateOf(123) }
we’ve actually been considering tweaking names or the API here because this is a common source of confusion
👍 3
z

zalewski.se

06/19/2020, 4:30 AM
@Leland Richardson [G] Talking about tweaking name and confusion, why there is vertical`Arrangement` but horizontal`Gravity` ? 😛 And then for
Arrangement
we have
Arrangement.Foo
but for
Gravity
we have
Alignment.Bar
🤯
👆 1
l

Leland Richardson [G]

06/19/2020, 4:32 AM
umm, i’m not really sure. i wasn’t involved in any of those decisions or api review. off the cuff, it does seem inconsistent. not sure if there’s a good reason or not
👆 1
👀 1
m

Mihai Popa

06/19/2020, 3:21 PM
We will tweak the naming for `Arrangement`/`Gravity` /`Alignment`. Currently
Arrangement
refers to positioning multiple children, while the other two refer to positioning one child individually. This distinction might remain, though it's indeed confusing that
Alignment
and
Gravity
are used interchangeably now - we will stick to one but it's TBD to which one 🙂
❤️ 2
1
2 Views