Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Anvil looks really promising. I wonder why doesn't it use "linearLayout {}" instead "v<LinearLayout> {}" syntax?


I'd guess because Anvil began as a Java project, and Kotlin is what provides the sugar that allows Anko to provide a nice DSL.


Almost correct. I never thought of this kind of syntax sugar initially. But technically (and people posted an issue about it) it's possible to generate functions like linearLayout() etc from android.jar for Anvil/Java. This will work with Anvil/Kotlin as well.

I plan to keep v<Class> anyway because it works nice with custom views when there is no generated syntax sugar.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: