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
多布局代理, new MultiTypeDelegate #968
Comments
Make it easier for multi type situation, set a delegate for
|
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.6' |
return entity.type; 请问这里的entity.type是返回的什么呢? |
你自己写的,区分type |
我的实体类使用的Retrifot添加Gson转换器直接存入实体类了,可以说下采用代理的话,实体类里面怎么写呢,小白一枚。我现在安装这样写出来,RecyclerView空白。 |
你gson解析完了有几个实体类呢?外边在套一个类
2017年6月14日 22:37,"DaiFalin" <notifications@github.com>写道:
… 我的实体类使用的Retrifot添加Gson转换器直接存入实体类了,可以说下采用代理的话,实体类里面怎么写呢,小白一枚。
我现在安装这样写出来,RecyclerView空白。
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#968 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALW_S2UsVqB9HkwEL28gbKI963rN40yuks5sD_BDgaJpZM4M1D2B>
.
|
有四种布局,但是只有两个bean,外面套一个类,应该怎么套呢,小白求大神指导。。。。 |
@z2700589 写代码的思维灵活一点,都是很简单的 |
recyclerview 嵌套recyclerview 报android.content.res.Resources$NotFoundException: Resource ID #0xfffffe6c |
@chaoDream 重新开个issue提问 |
没感觉这个委托的写法比原来的好啊 |
@zouzhenglu 解决了和实体类耦合的问题 这样就不需要强制去实现MultiItemEntity接口 |
那其实重写他的getItemType就可以了,这样啊还清晰点 |
有一个疑问:这种代理情况是在哪里设置list数据集? 构造方法没有参数传入 |
请问想根据行号设置布局可以做得到吗 |
在哪里传数据 |
构造方法内调用setnewdata 或者 修改构造方法参数不传null,传单参数你的list |
适配器进行 addFooterView(view) view不能有listview、Gridview、Recyclerview吗?我这边添加了不显示数据。 |
可以通过helper.getPoitson();
zhaijie1995@foxmail.com
发件人: 浅寻
发送时间: 2017-11-10 19:48
收件人: CymChad/BaseRecyclerViewAdapterHelper
抄送: z2700589; Mention
主题: Re: [CymChad/BaseRecyclerViewAdapterHelper] 多布局代理, new MultiTypeDelegate (#968)
1、怎么设置图片啊,我用Picasso的?
2、CheckBox的监听写在哪?convert方法只有item,没有position,根本没法更新data数据状态
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
这个多布局可以求一个简单的demo吗? |
android.content.res.Resources$NotFoundException: Resource ID #0xfffffe6c 会出现这种问题,怎么解决? |
我四种布局四个接口,好像用这个实现不了 |
你好 我使用多布局时没有回调MultiTypeDelegate中的getItemType方法 数据是有的 |
android.content.res.Resources$NotFoundException: Resource ID #0xfffffe6c 是什么原因啊,老铁?? |
@SuperKe 布局类型找不到。检查一下代码 |
在ItemProvider中如何处理子View的点击事件呢 |
可以根据position来返回不同的布局类型吗 |
这个解耦还是有好处的,比如你要抽象的一个方法里有BaseQuickAdapter 他和Mulit不是一个类型,就得写两套 |
其实跟重写getDefItemType()也可以有一样的效果吧。就继承BaseQuickAdapter. |
我也出现这个问题 |
后来怎么解决了? |
@RUANHAOANDROID 多布局情况?? |
正如你所说,我得到了解决,谢谢 |
多item使用时,recyclerview滑动时会卡顿。 |
实体类继承了MultiItemEntity,其中getItemType的返回值你应该返回的是0,正常应该返回itemType |
|
在使用多布局的时候adapter?.setNewData(it),it不是list怎么设置data |
最新版50,setMultiTypeDelegate()这个方法是不是取消了? |
@jackyHuangH |
怎么解决的亲? |
请问如何根据item的类型来初始化不同布局,这种只能一个holder对应一个布局,如果是聊天列表我想根据item是发送方还是接收方来实例化不同layout的布局 该如何实现 |
更便捷的多布局, 为
BaseQuickAdapter
设置代理多布局代理很简单,在任何继承与
BaseQuickAdapter
的 adapter 上都可以实现,分为三步,如下:Step.1
setMultiTypeDelegate()
, 并重写getItemType()
方法需要说明的是Entity 并不需要实现任何接口 ,只需要能够判断出该实体对应的是哪个布局类型即可
Step.2
getMultiTypeDelegate().registerItemType()
设置每种type对应的布局Step.3
convert()
操作OK, 多布局就可以顺利的运行了
The text was updated successfully, but these errors were encountered: