Skip to content

Commit ca04253

Browse files
committed
更新readme
1 parent 4bf927a commit ca04253

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

README.md

+28-27
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
### MVCHelper主要用于下拉刷新加载,失败,加载,空数据,成功的界面切换。
44
MVCHelper +(IDataSource或ITask)+ IDataAdapter + 下拉刷新控件 + 布局切换(ILoadViewFactory,ILoadView,ILoadMoreView)
55

6-
### TaskHelper主要用于没有布局切换和刷新控件的MVC架构,可以执行多个任务通过回调ICallback更新UI
7-
TaskHelper+(ITask或IDataSource)+ ICallBack
6+
**原先Task的代码已经抽离出单独一个类库:https://github.com/LuckyJayce/Task**
7+
88

9-
Download sample [Apk](https://github.com/LuckyJayce/MVCHelper/blob/master/raw/MVCHelper_Demo.apk?raw=true)
109

1110
### 历史版本和更新信息
1211
https://github.com/LuckyJayce/MVCHelper/releases
@@ -86,10 +85,10 @@ MVCHelper. 实现下拉刷新,滚动底部自动加载更多,分页加载,
8685
8786
​ //数据源
8887
89-
public interface IDataSource<DATA> {
90-
// 获取刷新的数据
91-
public DATA refresh() throws Exception;
92-
88+
public interface IDataSource<DATA> {
89+
// 获取刷新的数据
90+
public DATA refresh() throws Exception;
91+
9392
// 获取加载更多的数据
9493
public DATA loadMore() throws Exception;
9594

@@ -103,11 +102,11 @@ MVCHelper. 实现下拉刷新,滚动底部自动加载更多,分页加载,
103102
​ private int page = 1;
104103
​ private int maxPage = 5;
105104
106-
@Override
107-
public List<Book> refresh() throws Exception {
108-
return loadBooks(1);
109-
}
110-
105+
@Override
106+
public List<Book> refresh() throws Exception {
107+
return loadBooks(1);
108+
}
109+
111110
@Override
112111
public List<Book> loadMore() throws Exception {
113112
return loadBooks(page + 1);
@@ -286,8 +285,8 @@ https://github.com/LuckyJayce/MVCHelper/tree/master/app/src/main/java/com/shizhe
286285
287286
​ public interface IDataAdapter<DATA> {
288287
289-
public abstract void notifyDataChanged(DATA data, boolean isRefresh);
290-
288+
public abstract void notifyDataChanged(DATA data, boolean isRefresh);
289+
291290
public abstract DATA getData();
292291

293292
public boolean isEmpty();
@@ -300,11 +299,11 @@ https://github.com/LuckyJayce/MVCHelper/tree/master/app/src/main/java/com/shizhe
300299
​ private List<Book> books = new ArrayList<Book>();
301300
​ private LayoutInflater inflater;
302301
303-
public BooksAdapter(Context context) {
304-
super();
305-
inflater = LayoutInflater.from(context);
306-
}
307-
302+
public BooksAdapter(Context context) {
303+
super();
304+
inflater = LayoutInflater.from(context);
305+
}
306+
308307
@Override
309308
public View getView(int position, View convertView, ViewGroup parent) {
310309
if (convertView == null) {
@@ -355,8 +354,8 @@ Activity负责调度,代码如下
355354
356355
​ public class MainActivity extends Activity {
357356
358-
private MVCHelper<List<Book>> mvcHelper;
359-
357+
private MVCHelper<List<Book>> mvcHelper;
358+
360359
@Override
361360
protected void onCreate(Bundle savedInstanceState) {
362361
super.onCreate(savedInstanceState);
@@ -469,12 +468,13 @@ MVCHelper.setLoadViewFractory(new LoadViewFractory());
469468
*/
470469
​ public class BooDetailActivity extends Activity {
471470
472-
private MVCHelper<Book> listViewHelper;
473-
private TextView authorTextView;
474-
private TextView contentTextView;
475-
private TextView descriptionTextView;
476-
private TextView nameTextView;
477-
471+
​ private MVCHelper<Book> listViewHelper;
472+
​ private TextView authorTextView;
473+
​ private TextView contentTextView;
474+
​ private TextView descriptionTextView;
475+
​ private TextView nameTextView;
476+
477+
478478
@Override
479479
protected void onCreate(Bundle savedInstanceState) {
480480
super.onCreate(savedInstanceState);
@@ -562,6 +562,7 @@ MVCHelper.setLoadViewFractory(new LoadViewFractory());
562562

563563

564564

565+
565566
## 三、说明
566567

567568
** 以下是目前支持的下拉刷新的开源类库 **

0 commit comments

Comments
 (0)