예제 #1
0
 private void loadData(String url) {
   if (getMyActivity().hasNetWork()) {
     loadNewList(url);
   } else {
     mListView.onBottomComplete();
     mProgressBar.setVisibility(View.GONE);
     getMyActivity().showShortToast(getString(R.string.not_network));
     String result = getMyActivity().getCacheStr("CBAFragment" + currentPagte);
     if (!StringUtils.isEmpty(result)) {
       getResult(result);
     }
   }
 }
예제 #2
0
  @UiThread
  public void getResult(String result) {
    getMyActivity().setCacheStr("CBAFragment" + currentPagte, result);
    if (isRefresh) {
      isRefresh = false;
      newAdapter.clear();
      listsModles.clear();
    }
    mProgressBar.setVisibility(View.GONE);
    swipeLayout.setRefreshing(false);

    List<NewModle> list = NewListJson.instance(getActivity()).readJsonNewModles(result, Url.CBAId);
    // if (index == 0) {
    // initSliderLayout(list);
    // } else {
    newAdapter.appendList(list);
    // }
    listsModles.addAll(list);
    mListView.onBottomComplete();
  }