Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于databinding的tips #334

Closed
SmallDream opened this issue Aug 7, 2020 · 1 comment
Closed

关于databinding的tips #334

SmallDream opened this issue Aug 7, 2020 · 1 comment

Comments

@SmallDream
Copy link

查了下历史issue, 由于要使用createPopupById,暂不支持databinding。
但其实目前的项目已经可以通过一些其他方法来支持databinding.
使用DataBindingUtil.bind(getContentView())就可以使用databinding了。

public MyPop(Context context, Goods goods) {
        super(context);
        PopMyBinding binding = DataBindingUtil.bind(getContentView());

        ...
    }

    @Override
    public View onCreateContentView() {
        return createPopupById(R.layout.pop_my);
    }
@SmallDream SmallDream changed the title 关于databinding的建议 关于databinding的tips Aug 7, 2020
@razerdp
Copy link
Owner

razerdp commented Aug 7, 2020

ya,其实很早之前就加了 创建view之后的回调方法了:
onViewCreated()

demo中我的butterknife也是在那绑定的,所以databinding也可以

相关issue:

#232

相关文档:

https://www.yuque.com/razerdp/basepopup/yvlq1s

@razerdp razerdp closed this as completed Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants