首页 > 解决方案 > 跨模块使用 BR 是否安全?

问题描述

我有一个 Android 库模块com.lib和一个com.app依赖于 module的 Android 应用程序模块com.lib

com.lib中,我有一个dummy.xml使用数据绑定的布局,其中包括<variable name="somevar" ..>.

com.app我有一个布局some_layout.xml,它也使用数据绑定,它也有<variable name="somevar" ...>.

com.lib使用代码com.lib.BR.somevar(由于布局而可用)通过使用该方法dummy“动态”设置some_layout/的值是否安全?SomeLayoutBinding.setVariable

标签: androidandroid-databinding

解决方案


推荐阅读