コード例 #1
0
  @Override
  public RecyclerView.OnScrollListener getScrollListener() {
    if (scrollListener == null) {
      EndlessScrollListener endlessScrollListener = new EndlessScrollListener(layoutManager);
      endlessScrollListener.setOnLoadMoreDataListener(this);
      scrollListener = endlessScrollListener;
    }

    return scrollListener;
  }
コード例 #2
0
  @Override
  @SuppressWarnings("unchecked")
  public void onPostExecute(Object... result) {
    isRefreshing = false;
    if (isAttached) {
      swipeRefreshLayout.setRefreshing(false);
      adapter.setLoadingData(false);
      if (result != null && result.length > 0) {

        if (adapter != null) {
          if (offset == 0) {
            cryptoCustomerCommunityInformationList.clear();
            cryptoCustomerCommunityInformationList.addAll((ArrayList) result[0]);
            adapter.changeDataSet(cryptoCustomerCommunityInformationList);
            ((EndlessScrollListener) scrollListener).notifyDataSetChanged();
          } else {
            cryptoCustomerCommunityInformationList.addAll((ArrayList) result[0]);
            adapter.notifyItemRangeInserted(
                offset, cryptoCustomerCommunityInformationList.size() - 1);
            adapter.notifyDataSetChanged();
          }
        }
      }
    }

    showOrHideEmptyView();
  }
コード例 #3
0
  @Override
  public void onPostExecute(Object... result) {

    isRefreshing = false;
    if (isAttached) {
      swipeRefreshLayout.setRefreshing(false);
      adapter.setLoadingData(false);
      if (result != null && result.length > 0) {

        if (adapter != null) {
          if (offset == 0) {
            lstIntraUserInformations.clear();
            lstIntraUserInformations.addAll((ArrayList) result[0]);
            adapter.changeDataSet(lstIntraUserInformations);
            ((EndlessScrollListener) scrollListener).notifyDataSetChanged();
          } else {
            lstIntraUserInformations.addAll((ArrayList) result[0]);
            adapter.notifyItemRangeInserted(offset, lstIntraUserInformations.size() - 1);
          }

          if (lstIntraUserInformations != null) {
            if (lstIntraUserInformations.isEmpty()) {
              showEmpty(true, emptyView);
              showEmpty(false, searchEmptyView);
            } else {

              showEmpty(false, emptyView);
              showEmpty(false, searchEmptyView);
            }
          } else {

            showEmpty(false, emptyView);
            showEmpty(false, searchEmptyView);
          }
        }
      }
    }
  }