Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow aligning of a view to a group of views #27

Open
carranca opened this issue Sep 3, 2019 · 2 comments
Open

Allow aligning of a view to a group of views #27

carranca opened this issue Sep 3, 2019 · 2 comments
Assignees

Comments

@carranca
Copy link
Collaborator

carranca commented Sep 3, 2019

This is something accomplished using Barrier in ConstraintLayout, but I think we can make it more straightforward.

Given views A, B, C:

Scenarios

  1. Aligning a view A to at any given time be to the left of both B and C
  2. Aligning a view A to at any given time be to the right of both B and C
  3. Aligning a view A to at any given time be horizontally centered to the middle point between B and C
  4. Aligning a view A to at any given time be above both B and C
  5. Aligning a view A to at any given time be below both B and C
  6. Aligning a view A to at any given time be vertically centered to the middle point between B and C

When the layout of B or C is updated, the positioning of A must be updated.

@aerb aerb self-assigned this Sep 3, 2019
@oldergod
Copy link
Collaborator

Can't we do that already?

@jamolkhon
Copy link
Contributor

jamolkhon commented Jan 7, 2021

I'm pretty sure this is (now) supported.

1. x = leftOf { minOf(B.left(), C.left()) }
2. x = rightOf { maxOf(B.right(), C.right()) }
3. x = centerHorizontallyTo { XInt(abs(B.left().value - A.right().value)) }
4. etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants