This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
enhancement: Make implicit layout available to child views #40
Comments
What would be the syntax? Something like this? l[LinearLayout](
implicit l ⇒ w[Button] <~ lp(...),
implicit l ⇒ w[TextView] <~ lp(...)
) |
Also see this comment for an alternative idea. |
l[LinearLayout]( implicit layout =>
w[Button] <~ margin(all = 10 dp)
) |
So this is the same as in my first comment, right? |
Simliar, but maybe even just a signature like def l[L <: ViewGroup](op: L => Seq[Ui[View]]) |
Then you’ll have to wrap your views into a |
Agreed, but for things like margin, there isn't a much cleaner way is there? Overloading it at least make it an option. |
I see your point — will have to think about this. Feel free to make a PR with a solution of your own :) |
Sounds good. Will do! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Might get a bit crazy/unmanageable with multiple layers of nesting, but it would be great for type-checking on things like LayoutParams, to have an implicit layout available.
The text was updated successfully, but these errors were encountered: