예제 #1
0
 public void loadMore() {
   GiftModel.getInstance()
       .getGift(
           page,
           new DataCallback<Gift[]>() {
             @Override
             public void success(String info, Gift[] actions) {
               if (getView() != null) {
                 if (actions == null || actions.length == 0) getView().stopLoadMore();
                 else {
                   getView().addDate(actions);
                   mDateArrayList.addAll(Arrays.asList(actions));
                 }
                 page++;
               }
             }
           });
 }
예제 #2
0
 public void refresh() {
   GiftModel.getInstance()
       .getGift(
           0,
           new DataCallback<Gift[]>() {
             @Override
             public void success(String info, Gift[] actions) {
               if (getView() != null) {
                 if (actions == null || actions.length == 0) getView().stopRefresh();
                 else {
                   getView().stopRefresh();
                   getView().addDate(actions);
                   mDateArrayList.clear();
                   mDateArrayList.addAll(Arrays.asList(actions));
                   page = 1;
                 }
               }
             }
           });
 }