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

FeatureRequest : Generalize goneMargin #137

Open
EaseTheWorld opened this issue Feb 19, 2021 · 0 comments
Open

FeatureRequest : Generalize goneMargin #137

EaseTheWorld opened this issue Feb 19, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@EaseTheWorld
Copy link

EaseTheWorld commented Feb 19, 2021

When views orders are like these and all are optional.

View1
(10dp margin between 1-2)
View2
(20dp margin between 2-3)
View3

If I set view3's layout_marginTop=20dp and layout_goneMarginTop=10dp(if view2 is gone)
but then it can't handle the case that both view1 and view2 are gone.

To satisfy the design specification, I wish I can specify each margin and anchor combination.
for View3
layout_constraintTop_toBottomWithMargin="@id/view2 20dp" // if view2 is visible
layout_constraintGoneMarginTop1="@id/view1 10dp" // if view2 is gone
layout_constraintGoneMarginTop2="parent 0dp" // if view1&2 is gone

Specifying margin and anchor(=constraint) together makes sense because
in ConstraintLayout, marginTop is no use without constraintTop.

I added number suffix Top1, Top2, ... because xml doesn't allow dupicate attribute.
and I know specifying reference and dimension together is against the rule and require 'string' type.
I think there would be better format than this.

@EaseTheWorld EaseTheWorld added the enhancement New feature or request label Feb 19, 2021
@EaseTheWorld EaseTheWorld changed the title Generalize goneMargin FeatureRequest : Generalize goneMargin Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant