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

caelum19

04/25/2020, 10:26 PM
Hey I'm having some difficulties using ConstraintLayout. I expect this blue box to be at the bottom, am I doing it wrong somehow?
g

Gabriel Feo

04/25/2020, 11:01 PM
Trying to sort out some issues with ConstraintLayout too, but tested something similar to what you wrote, it's working
c

caelum19

04/25/2020, 11:02 PM
Oh, of course, it can't position its children inside itself if its the same size of the children! good spot thanks 😄
What issue are you having?
g

Gabriel Feo

04/25/2020, 11:11 PM
Constraints weren't being applied... Just found out I mispelled the tag on the modifier lol
c

caelum19

04/25/2020, 11:13 PM
haha I was doing that a few times too
What do you think about having the ConstraintLayout body inside of the body where constraint sets are defined so that the tags can be referenced as variables?
g

Gabriel Feo

04/25/2020, 11:19 PM
I don't think we'd need to mix those two, but I agree we should be defining the tag names in a common scope, to avoid these mistakes
I wish there was some overlap between
ConstraintSetBuilderScope.tag
and
Modifier.tag
though, so that we declare it once and just use it on the ConstraintSet and on the children
c

caelum19

04/25/2020, 11:22 PM
hmm but I guess it could be confusing if the common scope were common to more than one constraint layout?
g

Gabriel Feo

04/25/2020, 11:23 PM
It definitely could
But then again, if there are two ConstraintLayouts in the same scope, one of them (or both) should probably be extracted to a separate function
c

caelum19

04/25/2020, 11:33 PM
what sort of overlap do you have in mind? Like AS just looking at the strings or?
maybe that is the only way to bring safety without having people write not so elegant code
g

Gabriel Feo

04/25/2020, 11:38 PM
Thinking of a common type, which implements both
Modifier
and
ConstrainedLayoutReference
But I'm getting ahead of myself here, don't know much of the internals, that's probably not the best design choice
c

caelum19

04/25/2020, 11:41 PM
Oh so that you wouldn't need to wrap with Modifier.tag() ? I like the Modifier.x().y(), it indents nicer than +s
but yeah, we can hold off any prs for now 😛 just interesting to talk about
g

Gabriel Feo

04/25/2020, 11:49 PM
It is 🙃 I look forward to contributing, I'm trying to get up to speed
😄 1