DataBinding templates for Android Studio?

不打扰是莪最后的温柔 提交于 2021-02-05 07:44:28

问题


I've decided to use DataBinding library for my Android project. Are there any plugins/code templates available to install into Android Studio to get new Activity / Fragment etc added using Android Studio's wizard auto generated code compatible with DataBinding? I need to create models/presenters/variables in xml every time, can I get them to be generated automatically?


回答1:


you can ALT + Enter on your view root then convert into databinding layout .




回答2:


Well,it's not fully what am I looking for, but this looks promising: https://plugins.jetbrains.com/plugin/9271-databinding-support - int theory, it should able to convert standard layouts to data binding:

It basically intended to add all mising DataBinding integration to Android Studio. Shame Google is still not going to add any databinding integration to Android Studio and we need 3rd party plugins for that.




回答3:


You should customize templates and put it into the <Android Studio Installation path>\plugins\android\lib\templates folder.



来源:https://stackoverflow.com/questions/44888602/databinding-templates-for-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!