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

请教 #14

Open
jpsz01 opened this issue Apr 5, 2019 · 3 comments
Open

请教 #14

jpsz01 opened this issue Apr 5, 2019 · 3 comments

Comments

@jpsz01
Copy link

jpsz01 commented Apr 5, 2019

求教recyclerview中item包含了recyclerview,这个时候用你这套写法要怎么实现dataBinding

@ditclear
Copy link
Owner

ditclear commented Apr 5, 2019

其实就是多类型item布局的recyclerView,
我写了一个 https://github.com/ditclear/BindingListAdapter利用DataBinding简化了很多。
在PaoNet的代码中有同种情况的示例,见
https://github.com/ditclear/PaoNet/blob/master/app/src/main/java/com/ditclear/paonet/view/home/RecentFragment.kt

@jpsz01
Copy link
Author

jpsz01 commented Apr 6, 2019

感谢回复,不过可能是我表达的不是很清楚,我的意思是recyclerview中的item布局里嵌套了一个recyclerview,比如某项商品有商品的类别标签,这个类别标签个数是不定的,后台返回的是一个标签列表,所以在展示商品列表的同时,每个商品的item里又会有商品标签列表,这个标签列表是商品列表item里的其中一项信息,属于嵌套关系,不是单独的,所以跟多类型item还是有差异的,不能传图片很烦恼,类似于网上找的这个demo的布局:https://www.jianshu.com/p/3060acd90208

@ditclear
Copy link
Owner

ditclear commented Apr 6, 2019

是一个意思啊,就是recyclerView嵌套recyclerView嘛,和普通的做法没什么两样的。
大体思路就是整个是一个recyclerView,其中的某个item布局是recyclerView嘛
在recentFragment就是这样的情景啊
https://github.com/ditclear/PaoNet/blob/master/app/src/main/java/com/ditclear/paonet/view/home/RecentFragment.kt

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