-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add UIViewBox Implementation #1543
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
7e10282
to
6b48230
Compare
4d61460
to
fad23ca
Compare
fad23ca
to
f4fcc65
Compare
6b48230
to
32eb24b
Compare
f4fcc65
to
ca1657a
Compare
}, | ||
remove = { index, count -> | ||
val views = Array(count) { | ||
typedSubviews[index].also(UIView::removeFromSuperview) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: just to be safe, it can't hurt to bail early if index >= typedSubviews.size
, and maybe throw an error rather than crashing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally our strategy has been to explode loudly on unexpected input. It gives bugs fewer places to hide!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweet!
32eb24b
to
f962916
Compare
3b7a130
to
fd07927
Compare
f962916
to
4c6de08
Compare
fd07927
to
fda8102
Compare
4c6de08
to
1baf9ef
Compare
fda8102
to
02dd0f2
Compare
02dd0f2
to
0470b50
Compare
}, | ||
remove = { index, count -> | ||
val views = Array(count) { | ||
typedSubviews[index].also(UIView::removeFromSuperview) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally our strategy has been to explode loudly on unexpected input. It gives bugs fewer places to hide!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for taking this over
0470b50
to
2119bc1
Compare
Here are some of the layouts that this creates
I had to do some custom coloring of things inside of the widgets that I won't make part of this commit. I think I'll follow up with adding a backgroundColor property to the Button widget inside of test-app, but hoping to lean on #1541 for full support
The blue background is the actual
Box
widget.The green background is the
Row
that theBox
is contained inThe elements inside the box have outlines and their own colors
And this is how it looks without colors as a point of reference: