Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Sindre Tellevik
    @graknol
    @zserge @tilal6991 I just saw the new layout editor, this is baad news for DSL libraries (not like there's any competition)
    it's sweet though
    Lalit Maganti
    @tilal6991
    Having seen https://www.youtube.com/watch?v=csaXml4xtN8 I think that Anvil would do much better to just use the xml function as the main entry point
    For me personally the new XML editing tools I'm convinced to switch back
    Especially ConstraintLayout
    Sindre Tellevik
    @graknol
    me too
    truth is, not that many state changes happen that often
    which anvil was built for
    so there's normally no downside using the new tools
    Lalit Maganti
    @tilal6991
    I think that I'll take a look at reworking Anvil more as a tool for caching updates to views rather than acting as a DSL
    So just the virtual DOM part of react
    Sindre Tellevik
    @graknol
    Yeah, I've been thinking about that too
    Lalit Maganti
    @tilal6991
    @graknol @zserge please take a look at zserge/anvil#70
    Finally finished with exams :)
    Sindre Tellevik
    @graknol
    congratz!
    Serge Zaitsev
    @zserge
    @tilal6991 Great as usual! Strange how typing and a more explicit language syntax make code easier to understand at a glance
    Sindre Tellevik
    @graknol
    right? you would think it would be the other way around
    Serge Zaitsev
    @zserge
    @BenedictP Yeah, I've seen that talk, Anvil is just briefly mentioned there and unfortunately I haven't seen the reasons why they didn't choose to use it.
    Benedict
    @BenedictP
    ok, I'm still working on a mvvm architecture for android with anvil... need to write a little bit down so others can understnad it and add some tests
    Serge Zaitsev
    @zserge
    Great! Feel free to share or ask any questions. Meanwhile myself and Anna try to build a "real" android app using Anvil, which is an MQTT client that uses all support libraries, recycler view, toolbars, nav drawer and other over-complicated heavyweight gifts from google. However it goes better than I initially thought.
    Benedict
    @BenedictP
    wow.... recyclerview now supports drag and swipe via the new ItemTouchHelper. explained really short here: https://youtu.be/LqBlYJTfLP4?t=40m23s (little bit offtopic ;) )
    Benedict
    @BenedictP
    Sindre Tellevik
    @graknol
    finally!
    Basically bansa
    Benedict
    @BenedictP
    my mvvm architecture with anvil is online: https://github.com/BenedictP/NotesMVVM
    over the weekend I'm going to translate the readme (and fix the "uml" picture ;) )
    Stephen Fox
    @stevemasta34
    I've got a question about using Anvil's RenderableAdapter
    I want to make a TodoMVC with Anvil, because I love the mindset of functional + composable components for Views (over Fragments 😒), but I need some examples
    Or docs
    Never mind 😅
    Lalit Maganti
    @tilal6991
    @zserge would you be open to exposing the internals of Anvil?
    i.e. Mount, Attr, Node etc?
    My idea is to separate the creation of the DOM from the rendering part
    Make it a two part system
    I've been exploring JS approaches to DOM rendering and most of them seem to have this feature
    DavidMihola
    @DavidMihola
    @BenedictP What happened to your MVVM example? The ones I know of all use Android's Data Binding so I'd love to see an alternative using Anvil!
    Yannick
    @ElectricCookie

    Hey there. I'm trying to render a textInputLayout, but my app keeps crashing during the second render-cycle with the following exception: java.lang.IllegalArgumentException: We already have an EditText, can only have one

    The view looks like this:

    DesignDSL.textInputLayout(() -> {
        DSL.layoutGravity(DSL.TOP);
        DesignDSL.hint(getContext().getString(R.string.connect_hint_port));
        DesignDSL.textInputEditText(() -> {
            DSL.inputType(InputType.TYPE_CLASS_NUMBER);
            DSL.enabled(state.connect().state() != State.CONNECT_STATE.CONNECTING);
            DSL.text(String.valueOf(state.connect().port())); 
            DSL.onTextChanged((s) -> {
                 App.getInstance().getStore().dispatch(new Action("CONNECT_SET_PORT",s.toString()));
            });
           });
    });

    I also tried using a standard DSL.editText() but still not working.. Thanks!

    Earl St Sauver
    @estsauver
    Hey there! I have what should be a quick question. Anvil comes in a bunch of build flavors, is there any reason to not just use the earliest possible build flavor (SDK-15)? Am I missing out on something by choosing the older SDK?
    Serge Zaitsev
    @zserge
    @estsauver Different SDK variants contain just different DSL.java classes generated from different android.jar. I normally use sdk-19 these days, but you may choose either of them.
    Have a look here to see which DSL methods are available in SDK19 only (or in SDK21 only) - https://github.com/zserge/anvil/blob/master/DSL.md
    Mitch Ryan Jusay
    @mitchryanjusay
    Hi guys, I'm pretty new to anvil and i've encountered @ElectricCookie 's problem with the TextInputLayout, actually, aside from the error when re-rendered it's not showing its hint and also not animating.
    Also any update on this @zserge zserge/anvil#83
    Jacob Henry
    @jachenry
    @zserge I'm looking to suggest Anvil on a project I help develop but zserge/anvil#81 is a blocker. Could you give me some tips on how to fix? It'll be nice to play around with the code.
    Guilherme Araújo
    @guilhermearaujo
    Hi! How can I set a button's style using Anvil? There is no style() method
    Serge Zaitsev
    @zserge
    @/all Hello, smiths! I'm working on Anvil 0.5.0. The major change so far is getting rid of the virtual nodes and using real views instead (yes, there was no performance gain from using virtual nodes!). This helps to fix issues with XML layouts and nasty widgets from the support libraries.
    Also I'm making a change where attributes are identified by string literals (not lambda singletons) and dispatched with a switch/case statement and not hundreds of lambas. This reduces method count at least in half and allows to use the same attribute name in multiple handlers (e.g. gravity() in core DSL and gravity() in the support DSL, also users can do their own "middleware" to handle their own custom view attributes). This opens a way to proper components.
    There is a lot to be done (getting rid of reflection in view factories to speed up view construction, adding keys to views to identify similar views somehow), but it seems to be usable enough to test it. I've ensured that anvil-examples work fine and some of my project also run correctly with Anvil 0.5.0. I think it should be pretty much backwards compatible with Anvil 0.4.0.
    So feel free to clone the "anvil-forge" branch, run ./gradlew publishToMavenLocal and give it a try!
    Serge Zaitsev
    @zserge
    Just merged forge branch into master. If anyone had issues with Anvil 0.4.0 - there is a good chance that new master branch changes fix them (or show them in a different light).
    robinchew
    @robinchew
    Hi everyone, I'm new to Android development, but familiar with web frontend development using Mithril. When I read up on fragments since it is the blessed way of doing Android dev, I was scared into searching for alternatives. I searched for 'android virtual dom' and I was pleased to find someone @zserge being inspired by mithril, resulting with Anvil.
    One of the killer features of mithril over react, is that I can easily fallback to my dirty ways of jquery dom manipulation post render.