Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Lalit Maganti
    @tilal6991
    I actually like the idea of a children block as well
    It clearly differentiates the parent attrs and the children
    Something which Anvil/Anko don't have atm
    Sindre Tellevik
    @graknol
    you dont even have to write it either
    so it's as transparent as now
    Lalit Maganti
    @tilal6991
    What do you mean you don't have to write it?
    Sindre Tellevik
    @graknol
    fun linearLayout(r: LinearLayoutChildren.() -> Unit) = LinearLayoutChildren.r()
    the dsl function wraps it
    in some way
    there's the inspiration for the operator magic btw ;)
    at the bottom
    Lalit Maganti
    @tilal6991
    Ohhhhhhhhhhhhhhhhhhhh wow
    It's even better than I thought
    Wow
    Sindre Tellevik
    @graknol
    @zserge himself
    Lalit Maganti
    @tilal6991
    <3 Kotlin
    Sindre Tellevik
    @graknol
    :P
    <3 Kotlin
    Lalit Maganti
    @tilal6991
    I didn't see that you could do another layer of wrapping
    Yeah the operator magic stuff is cool
    Sindre Tellevik
    @graknol
    Kotlin is all about that wrappin ;)
    yeah, but that'll have to wait 'till later, sadly
    Lalit Maganti
    @tilal6991
    Yup yup
    Sindre Tellevik
    @graknol
    but now we have a new problem
    how do we access the linearLayout setters?
    Lalit Maganti
    @tilal6991
    Make it a subclass of linearLayout right?
    The linearlayout config class that is
    Sindre Tellevik
    @graknol
    but then, dumdumdudm! we have the same problem, don't we?
    Lalit Maganti
    @tilal6991
    Right which I suspected initially
    Sindre Tellevik
    @graknol
    I could pass the LayoutParams as a parameter to the function
    Lalit Maganti
    @tilal6991
    Which is why the whole children idea came about
    Sindre Tellevik
    @graknol
    linearLayout{ relativeLayout{ layoutParams.set {} } }
    fuck, then you'll have to specify it
    Lalit Maganti
    @tilal6991
    But you'll need to say it right?
    Sindre Tellevik
    @graknol
    in the dsl function
    Lalit Maganti
    @tilal6991
    Yeah exactly
    Sindre Tellevik
    @graknol
    yeah something like that
    ffffaaaakkk
    I'll sleep on it
    good night 🌃
    Lalit Maganti
    @tilal6991
    Sure
    GN
    Sindre Tellevik
    @graknol
    Now I see what I did wrong with that children { } you talked about
    yes it works when you dont wrap it (ofc it's why we added it, I'm just stupid)
    but I'm still trying to do this, and I'm confident (sorta :P)
    well that was easy...
    Sindre Tellevik
    @graknol
    Anko has it simpler, since they have the whole View tree
    but unless we somehow rewrite the core of Anvil to better support types and context objects, rather than pure functions, I hardly believe we can do anything better like you said :(
    So, I've decided, that until something gets done in that department, I'm not providing any layoutParams functions