Skip to content

Commit 02bf4f7

Browse files
Update README_ZH_CN.md
1 parent 857ccd6 commit 02bf4f7

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

README_ZH_CN.md

+2-29
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
- 可设置重新请求数据的事件
1616
- 可动态更新视图样式
1717
- 可结合绝大部分第三方控件使用
18-
- 可对内容进行预处理
1918

2019
## 示例
2120

@@ -53,7 +52,7 @@ allprojects {
5352

5453
```
5554
dependencies {
56-
implementation 'com.github.DylanCaiCoding:LoadingHelper:2.2.0'
55+
implementation 'com.github.DylanCaiCoding:LoadingHelper:2.3.0'
5756
}
5857
```
5958

@@ -124,9 +123,7 @@ errorAdapter.notifyDataSetChanged();
124123
和前面的用法类似,先创建一个继承 `LoadingHelper.Adapter<VH extends ViewHolder>` 的标题栏适配器,然后就能在内容的上方添加标题栏了,可以添加多个头部。
125124

126125
```java
127-
loadingHelper.register(ViewType.TITLE, new TitleAdapter("标题名"));
128-
loadingHelper.register(VIEW_TYPE_SEARCH, new SearchHeaderAdapter(onSearchListener));
129-
loadingHelper.setDecorHeader(ViewType.TITLE, VIEW_TYPE_SEARCH);
126+
loadingHelper.setDecorHeader(new TitleAdapter("标题名"), new SearchHeaderAdapter(onSearchListener));
130127
```
131128

132129
如果是**特殊的标题栏**,比如有联动效果,就不能直接使用上面的方式了。这时我们要给内容增加个装饰的容器。
@@ -202,30 +199,6 @@ loadingHelper.setDecorAdapter(new ScrollDecorAdapter());
202199

203200
上述的两种使用方式都是可以进行多次设置,不过每次设置会把上一次设置的样式给替换掉。
204201

205-
#### 预处理内容视图
206-
207-
创建一个适配器继承 `LoadingHelper.ContentAdapter<VH extends ViewHolder>`。如果想要使用 Activity 对象,可以在构造方法传入或者通过 contentView 获得。
208-
209-
```java
210-
public class CommonContentAdapter extends LoadingHelper.ContentAdapter<LoadingHelper.ViewHolder> {
211-
@Override
212-
public LoadingHelper.ViewHolder onCreateViewHolder(@NonNull View contentView) {
213-
return new LoadingHelper.ViewHolder(contentView);
214-
}
215-
216-
@Override
217-
public void onBindViewHolder(@NonNull LoadingHelper.ViewHolder holder) {
218-
View contentView = holder.getRootView();
219-
}
220-
}
221-
```
222-
223-
在创建 `LoadingHelper` 对象时传入 `ContentAdapter` 对象,就会立即对内容视图进行处理。
224-
225-
```java
226-
loadingHelper= new LoadingHelper(this, new CommonContentAdapter());
227-
```
228-
229202
## 感谢
230203

231204
- [luckbilly/Gloading](https://github.com/luckybilly/Gloading) 站在了巨人肩膀上优化了本库,非常感谢!

0 commit comments

Comments
 (0)