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

tjohnn

07/25/2020, 5:54 PM
Another question, why is it that paddings on
Card
's are somehow showing as margins? Am I getting it wrong?
a

Adam Powell

07/25/2020, 6:00 PM
Modifiers always decorate the outside of an element. Try setting it on the
Column
instead.
1
t

tjohnn

07/25/2020, 6:03 PM
Ah I see.. thank you.
But are there margins then? What would be their usecases since paddings seem to act like margings @Adam Powell
a

Adam Powell

07/25/2020, 6:09 PM
Padding can serve both purposes. You can arrange modifiers in any order you choose
Android's margin distinction has always been that margins are LayoutParams, interpreted by the parent ViewGroup and applied according to that parent ViewGroup's implementation
👍 1
Compose's padding increases the size of the element as its parent measures it, making it parent-independent.
👏 1
t

tjohnn

07/25/2020, 6:13 PM
Sounds great. Thanks
👍 1
m

Mark Murphy

07/25/2020, 6:24 PM
FWIW, this thread covers some more of the thinking behind the padding/margin implementation: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1593799693346200
👍 2
t

tjohnn

07/25/2020, 6:50 PM
Thanks for sharing the thread Mark
👍 1