示例#1
0
  public void loadMore(final Boolean needClear) {
    if (!iDataSource.hasMore()) {
      iAction.onAlreadyEnd();
      return;
    }

    iDataSource.cancleLoadTask();

    iAction.onLoadBegin();
    iDataSource.getLoadMoreData(
        new Interfaces.IGetDataCallBack() {
          @Override
          public void onSuccess(List dataList) {
            if (needClear) {
              Model.this.dataList.clear();
            }
            Model.this.dataList.addAll(dataList);
            iAction.onLoadSuccess(Model.this.dataList);
          }

          @Override
          public void onFail() {
            iAction.onLoadFailed();
          }

          @Override
          public void onError() {
            iAction.onLoadError();
          }
        });
  }
示例#2
0
 public void firstIn() {
   this.dataList.clear();
   iDataSource.onGetRefreshData();
   if (null != iDataSource.getFirstInData() && 0 != iDataSource.getFirstInData().size()) {
     dataList.addAll(iDataSource.getFirstInData());
     iAction.onLoadSuccess(Model.this.dataList);
   }
   loadMore(true);
 }
示例#3
0
 public void refresh() {
   iDataSource.onGetRefreshData();
   loadMore(true);
 }