Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
儿歌八万首
BaseRecyclerViewAdapterHelper
提交
329a955b
B
BaseRecyclerViewAdapterHelper
项目概览
儿歌八万首
/
BaseRecyclerViewAdapterHelper
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
BaseRecyclerViewAdapterHelper
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
329a955b
编写于
7月 28, 2019
作者:
limuyang2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update README
上级
b6416fca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
13 deletion
+33
-13
README-cn.md
README-cn.md
+27
-1
README.md
README.md
+6
-12
未找到文件。
README-cn.md
浏览文件 @
329a955b
...
...
@@ -42,7 +42,7 @@
然后在dependencies添加:
```
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.4
6
'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.4
7
'
}
```
## [androidX 迁移库版本](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/releases/tag/2.9.45-androidx)
...
...
@@ -495,6 +495,32 @@ mAdapter.setNewDiffData(callback);
mAdapter
.
notifyItemChanged
(
0
,
"payload info"
);
```
## 异步Diff & 原始DiffUtil.Callback
用户可以直接使用
`DiffUtil.Callback`
,自己进行diff计算,将结果告知adapter即可。
所以adapter并不关心diff计算过程,用户可以同步或是异步进行。
使用如下方法:
```
java
setNewDiffData
(
DiffUtil
.
DiffResult
,
List
)}
```
例子:
```
java
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
final
List
<
DiffUtilDemoEntity
>
newData
=
getNewList
();
DiffDemoCallback
callback
=
new
DiffDemoCallback
(
newData
);
final
DiffUtil
.
DiffResult
diffResult
=
DiffUtil
.
calculateDiff
(
callback
,
false
);
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
mAdapter
.
setNewDiffData
(
diffResult
,
newData
);
}
});
}
}).
start
();
```
>警告:你应该自己进行多线程管理,防止内存泄漏
>**持续更新!,所以推荐Star项目**
...
...
README.md
浏览文件 @
329a955b
...
...
@@ -10,7 +10,8 @@ kotlin demo :[BRVAH_kotlin](https://github.com/AllenCoder/BRVAH_kotlin)
## [androidX stable version ](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/releases/tag/2.9.45-androidx)
# Document
-
[
English
](
https://github.com/CymChad/BaseRecyclerViewAdapterHelper/wiki
)
-
[
中文
](
http://www.jianshu.com/p/b343fcff51b0
)
-
[
中文1
](
https://github.com/CymChad/BaseRecyclerViewAdapterHelper/blob/master/README-cn.md
)
-
[
中文2
](
http://www.jianshu.com/p/b343fcff51b0
)
## [UI](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/issues/694)
## Demo
...
...
@@ -20,17 +21,10 @@ kotlin demo :[BRVAH_kotlin](https://github.com/AllenCoder/BRVAH_kotlin)
[
国内下载地址
](
https://fir.im/s91g
)
# proguard-rules.pro
```
-keep class com.chad.library.adapter.** {
*;
}
-keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
-keep public class * extends com.chad.library.adapter.base.BaseViewHolder
-keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
<init>(...);
}
-keepattributes InnerClasses
```
> 此资源库自带混淆规则,并且会自动导入,正常情况下无需手动导入。
> The library comes with `proguard-rules.pro` rules and is automatically imported. Normally no manual import is required.
> You can also go here to view [proguard-rules](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/blob/master/library/proguard-rules.pro)
# Extension library
[
PinnedSectionItemDecoration
](
https://github.com/oubowu/PinnedSectionItemDecoration
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录