提交 329a955b 编写于 作者: limuyang2's avatar limuyang2

update README

上级 b6416fca
......@@ -42,7 +42,7 @@
然后在dependencies添加:
```
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.47'
}
```
## [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项目**
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册