com.jcodecraeer.xrecyclerview.XRecyclerView.setVisibility()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中com.jcodecraeer.xrecyclerview.XRecyclerView.setVisibility()方法的一些代码示例,展示了XRecyclerView.setVisibility()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XRecyclerView.setVisibility()方法的具体详情如下:
包路径:com.jcodecraeer.xrecyclerview.XRecyclerView
类名称:XRecyclerView
方法名:setVisibility

XRecyclerView.setVisibility介绍

暂无

代码示例

代码示例来源:origin: CarGuo/linkagescroll

@Override
public void onChanged() {
  Adapter<?> adapter = getAdapter();
  if (adapter != null && mEmptyView != null) {
    int emptyCount = 0;
    if (pullRefreshEnabled) {
      emptyCount++;
    }
    if (loadingMoreEnabled) {
      emptyCount++;
    }
    if (adapter.getItemCount() == emptyCount) {
      mEmptyView.setVisibility(View.VISIBLE);
      XRecyclerView.this.setVisibility(View.GONE);
    } else {
      mEmptyView.setVisibility(View.GONE);
      XRecyclerView.this.setVisibility(View.VISIBLE);
    }
  }
  if (mWrapAdapter != null) {
    mWrapAdapter.notifyDataSetChanged();
  }
}

代码示例来源:origin: zhujun2730/WeiKanDian

private void handleResponseData(HomeNewsData homeNewsData, int type) {
  if (type == PULL_TO_REFRESH) { // 下拉刷新
    mProgressBar.setVisibility(View.GONE);
    if (homeNewsData.getItems() != null) {
      pullStep = homeNewsData.getStep();
      mRecyclerView.setLoadingMoreEnabled(true);
      mTextViewError.setVisibility(View.GONE);
      mRecyclerView.setVisibility(View.VISIBLE);
      homeNewsDataItems.clear();
      homeNewsDataItems.addAll(homeNewsData.getItems());
      homeRecyclerViewAdapter.notifyDataSetChanged();
    } else if (homeNewsDataItems.isEmpty()) {
      mTextViewError.setVisibility(View.VISIBLE);
    }
    mRecyclerView.refreshComplete();
  } else { // 加载更多
    if (homeNewsData.getItems() != null) {
      moreStep = homeNewsData.getStep();
      mTextViewError.setVisibility(View.GONE);
      mRecyclerView.setVisibility(View.VISIBLE);
      homeNewsDataItems.addAll(homeNewsData.getItems());
      homeRecyclerViewAdapter.notifyDataSetChanged();
    }
    mRecyclerView.loadMoreComplete();
  }
}

相关文章