Skip to content

Commit

Permalink
添加一个重复刷新错误的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxikang committed May 11, 2017
1 parent 57314f1 commit 5601653
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface View {

void loadError();
void loadNextPageError();
void reLoadError();

}

Expand All @@ -48,6 +49,8 @@ interface Presenter {

void onRefreshError();

void onReloadError();

void onLoadNextError();

void stopLoading();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void checkAndRefreshData() {

@Override
public void stopLoading() {
canLoad=true;
canLoad = true;
mView.closeLoadAnimation();
}

Expand All @@ -81,6 +81,13 @@ public void onLoadNextError() {
mView.loadNextPageError();
}

@Override
public void onReloadError() {
canLoad = true;
mView.closeLoadAnimation();
mView.reLoadError();
}

private void beforeLoad() {
mView.showLoadAnimation();
canLoad = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public void loadNextPageError() {

}

@Override
public void reLoadError() {
Snackbar.make(recyclerView, "加载失败", Snackbar.LENGTH_SHORT).show();
}

@Override
public RecyclerView getRecyclerView() {
return recyclerView;
Expand Down

0 comments on commit 5601653

Please sign in to comment.