Exemple #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();
          }
        });
  }
Exemple #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);
 }