Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    aaronpoweruser
    @aaronpoweruser
    Is there a wa to set layout_scrollFlags on a CollapsingToolbarLayout in current anvil
    Sindre Tellevik
    @graknol
    are you using the kotlin or java version?
    aaronpoweruser
    @aaronpoweruser
    Java, but I can switch if needed
    Sindre Tellevik
    @graknol
    nono that's not needed
    lparams = (CollapsingToolbarLayout.LayoutParams) Anvil.currentView<View>().getLayoutParams()
    then set scrollFlags
    and call DSL.layoutParams(lparams)
    all of this must happen inside view() and your child view you're doing this on
    aaronpoweruser
    @aaronpoweruser
    thanks
    Sindre Tellevik
    @graknol
    np :)
    Sindre Tellevik
    @graknol
    Could someone point out what would potentially be wrong with this implementation? https://gist.github.com/graknol/e4608a6e3fa60189908126c7fcc7bc7f
    Sindre Tellevik
    @graknol
    dammit it would have been so nice, but inheritance kills it, children can't inherit from both the Android class and this one :/
    Sindre Tellevik
    @graknol
    @tilal6991 @brianegan What do you think about this approach? https://github.com/graknol/AnvilCore
    This way, one's not stuck with a single library, but can choose which DSL library one would like to use (or not DSL at all)
    Lalit Maganti
    @tilal6991
    Hmmmmm
    Sindre Tellevik
    @graknol
    Ofc, I will solve the nesting problem though
    Lalit Maganti
    @tilal6991
    Right now feels quite unwieldy to Mr.
    *me
    The idea of wrapping properties feels too much like android databinding.
    Which I really did not like doing.
    I moved to anvil specifically to get away from that.
    And at that point you might as well us android databinding.
    *use
    Sindre Tellevik
    @graknol
    hmm true :/
    Serge Zaitsev
    @zserge
    http://blog.jetbrains.com/kotlin/2016/05/gradle-meets-kotlin/ - I'm not sure if this means that DSL generator can now be rewritten in Kotlin, but that would be a nice improvement
    Sindre Tellevik
    @graknol
    omg!
    btw, I saw that anko generated the DSL from the local android.jar, does Anvil do that too, or does it just use a precompiled one?
    Serge Zaitsev
    @zserge
    Well, yes and no. Anvil generates DSL from android.jar in the local ANDROID_HOME SDK path, but the generated DSL is also stored under version control and included to the published JARs.
    Sindre Tellevik
    @graknol
    ok, I guess it doesn't make a whole lot of difference anyways
    Sindre Tellevik
    @graknol
    I know this is not Anvil related, but damn these new reference pages! https://developer.android.com/reference/android/webkit/WebView.html
    Sindre Tellevik
    @graknol
    @tilal6991 I did it
    linearLayout {
        button {
            text("EAT SHIT!")
        }.lparams {
            width = dip(320)
            height = dip(160)
            gravity = 1
        }
    }
    Lalit Maganti
    @tilal6991
    Nice!
    Sindre Tellevik
    @graknol
    best of all
    no generics!
    I'll push it later today, when I've modified all the libraries
    Sindre Tellevik
    @graknol
    Lalit Maganti
    @tilal6991
    @graknol Excellent
    Only thing I can see is that the DSL result stub is created a lot
    Can we not make that a singleton?
    Sindre Tellevik
    @graknol
    no, because it has to contain a reference to the currentView after the currentView is gone. if that made sense
    Lalit Maganti
    @tilal6991
    Hmmmmm right.
    Sindre Tellevik
    @graknol
    otherwise we could try to somehow store a stack of views
    Lalit Maganti
    @tilal6991
    A bit frustrating that that's the case but I understand.
    Sindre Tellevik
    @graknol
    it's because of anvil's design :/
    but an incredible improvent nontheless!
    Lalit Maganti
    @tilal6991
    Yes definitely.
    Lalit Maganti
    @tilal6991
    Ouch without some sort of editor plugin, constraintlayout will remain XML only
    Will be very difficult to do with Anvil