@@ -15,7 +15,6 @@ English | [中文](README_ZH_CN.md)
15
15
- Support for set reload event.
16
16
- Support for update views anytime.
17
17
- Support for use with most third-party libraries.
18
- - Support for preprocessing the content view.
19
18
20
19
## Demo
21
20
@@ -48,7 +47,7 @@ Add dependencies in your module `build.gradle` :
48
47
49
48
```
50
49
dependencies {
51
- implementation 'com.github.DylanCaiCoding:LoadingHelper:2.2 .0'
50
+ implementation 'com.github.DylanCaiCoding:LoadingHelper:2.3 .0'
52
51
}
53
52
```
54
53
@@ -129,9 +128,7 @@ If you want to add an ordinary title bar above the content.
129
128
Similar to the previous usage, create a class extends ` LoadingHelper.Adapter<VH extends ViewHolder> ` and set header.
130
129
131
130
``` java
132
- loadingHelper. register(ViewType . TITLE , new TitleAdapter (" title" ));
133
- loadingHelper. register(VIEW_TYPE_SEARCH , new SearchHeaderAdapter (onSearchListener));
134
- loadingHelper. setDecorHeader(ViewType . TITLE , VIEW_TYPE_SEARCH );
131
+ loadingHelper. setDecorHeader(new TitleAdapter (" title" ), new SearchHeaderAdapter (onSearchListener));
135
132
```
136
133
137
134
If you want to add an special title bar with linkage effect.
@@ -160,30 +157,6 @@ Then set it up.
160
157
loadingHelper. setDecorAdapter(new ScrollDecorAdapter ());
161
158
```
162
159
163
- #### Preprocessing the content view
164
-
165
- Create a adapter extends ` LoadingHelper.ContentAdapter<VH extends ViewHolder> ` .
166
-
167
- ``` java
168
- public class CommonContentAdapter extends LoadingHelper .ContentAdapter<LoadingHelper .ViewHolder > {
169
- @Override
170
- public LoadingHelper .ViewHolder onCreateViewHolder (@NonNull View contentView ) {
171
- return new LoadingHelper .ViewHolder (contentView);
172
- }
173
-
174
- @Override
175
- public void onBindViewHolder (@NonNull LoadingHelper .ViewHolder holder ) {
176
- View contentView = holder. getRootView();
177
- }
178
- }
179
- ```
180
-
181
- Create a ` LoadingHelper ` with the ` ContentAdapter ` .
182
-
183
- ``` java
184
- LoadingHelper loadingHelper = new LoadingHelper (this , new CommonContentAdapter ());
185
- ```
186
-
187
160
## Thanks
188
161
189
162
- [ luckbilly/Gloading] ( https://github.com/luckybilly/Gloading ) Optimize my library standing on the shoulders of giants.
0 commit comments