3 ms·
I really like that projects such as Anko & Anvil exist but I am not a fan of declaring layouts in the middle of the Activity's code. I am have nothing against
by on_and_off 11y ago
I really like that projects such as Anko & Anvil exist but I am not a fan of declaring layouts in the middle of the Activity's code.
I am have nothing against getting rid of XML : it is not that bad in practice since the IDE writes the boring parts but still ugly to read.
Separating the presentation from the code is an important feature though, especially for very large applications.
- zserge 11y agoThat's why Anvil has the lightweight concept of "renderable" - it's just a lambda with view hierarchy declaration, which can be put anywhere you find appropriate in your architecture - in activities, fragments, in self-contained components, in special dedicated "view" layer classes, you can move common parts into separate styles module etc etc. Since you have the full power of your programming language you are free to refactor it any way you like. Anvil has no restrictions on that.
- on_and_off 11y agothanks for replying. tbh, I have not tested Anvil yet, I should, if only by curiosity. Suggestion : I don't see anything regarding density buckets, composability with merge tags or other strengths of the existing system on the repo readme. It might be a good idea to treat these as well.