com.youth.banner.Banner.setVisibility()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(109)

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

Banner.setVisibility介绍

暂无

代码示例

代码示例来源:origin: jenly1314/WanAndroid

/**
 * 更新banner
 * @param data
 */
private void updateBanner(List<BannerBean> data){
  if(data!=null && data.size()>0){
    listBanner = data;
    List<String> urls = new ArrayList<>();
    List<String> titles = new ArrayList<>();
    int size = data.size();
    for (int i = 0; i < size; i++) {
      BannerBean bean = data.get(i);
      titles.add(bean.getDesc());
      urls.add(bean.getImagePath());
    }
    mBinding.banner.setVisibility(View.VISIBLE);
    mBinding.banner.setBannerTitles(titles);
    mBinding.banner.setImages(urls);
    mBinding.banner.start();
  }else{
    mBinding.banner.setVisibility(View.GONE);
  }
}

代码示例来源:origin: dom4j1/Red

@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(String date) {
  mStories.clear();
  mBanner.setVisibility(View.GONE);
  mAdapter.setDataList(mStories);
  mSpinkit.setVisibility(View.VISIBLE);
  mPresenter.getBeforeList(date);
}

代码示例来源:origin: dom4j1/Red

@Override
public void showDailyList(HomeListBean data) {
  if (mSwipRefresh.isRefreshing()) {
    mSwipRefresh.setRefreshing(false);
  }
  mBanner.setVisibility(View.VISIBLE);
  mTitles.clear();
  mUrls.clear();
  mTime.setText("今日热闻");
  mStories = data.getStories();
  List<HomeListBean.TopStoriesBean> top_stories = data.getTop_stories();
  for (HomeListBean.TopStoriesBean bean : top_stories) {
    mUrls.add(bean.getImage());
    mTitles.add(bean.getTitle());
  }
  mAdapter.setDataList(mStories);
  mBanner.setImages(mUrls);
  mBanner.setBannerTitles(mTitles);
  mBanner.start();
  mRecyclerView.setAdapter(mAdapter);
}

相关文章