When using Views DSL for `ConstraintLayout`, would...
# splitties
l
When using Views DSL for
ConstraintLayout
, would you prefer to use
below(view)
instead of
topToBottomOf(view)
,
above
instead of
bottomToTopOf
,
before
instead of
endToStartOf
and
after
instead of
startToEndOf
? I'm considering adding these into the ConstraintLayout module as aliases to the existing ones.
🚫 1
👌 3
r
before
and
after
aren’t as clearly horizontal as
below
and
above
are vertical
But yeah I think it would be better
l
I can also skip the horizontal helpers and provide only
below
and
above
.
I don't need them for now.
i
You can follow convention from Contour. For me startTo, endTo looks good (or leftTo/rightTo, but it is not good for RTL languages...)
l
I'm afraid
startTo
and
endTo
would be a little confusing among
startToStartOf
,
startToEndOf
,
endToStartOf
and
endToEndOf
. Note that
after
and
before
are already used as CSS selectors in W3C standards for WEB.
👍 1
i
Sounds reasonable!
l
I'm adding this:
Copy code
inline fun LP.before(view: View) = endToStartOf(view)
inline fun LP.above(view: View) = bottomToTopOf(view)
inline fun LP.after(view: View) = startToEndOf(view)
inline fun LP.below(view: View) = topToBottomOf(view)
I'm thinking of adding
bottomOf
,
startOf
, etc extension that would be aliases to
bottomToBottomOf
,
startToStartOf
, etc. Would you use it? Should I proceed? Or do you dislike the naming? What's now is enough?