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

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

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

Banner.setBannerTitles介绍

暂无

代码示例

代码示例来源:origin: Vegen/SmartCampus

@Override
public void showBanner(List<com.itculturalfestival.smartcampus.entity.db.Banner> bannerList) {
  imgs.clear();
  titles.clear();
  this.bannerList.clear();
  if (bannerList != null) {
    this.bannerList.addAll(bannerList);
    for (com.itculturalfestival.smartcampus.entity.db.Banner banner : bannerList) {
      imgs.add(banner.getImgUrl());
      titles.add(banner.getTitle());
    }
  }
  banner.setImages(imgs);
  banner.setBannerTitles(titles);
  banner.start();
}

代码示例来源:origin: BolexLiu/ApkBusBlog

@Override
public void findHomeBanner(List<bolex.com.apkbus.Blog.entity.Banner> banners) {
  for (bolex.com.apkbus.Blog.entity.Banner banner : banners) {
    titles.add(banner.getTitle());
    images.add(banner.getImgUrl());
  }
  banner.setImages(images);
  banner.setBannerTitles(titles);
  banner.start();
  ViseLog.d(banners);
}

代码示例来源:origin: gaolhjy/enjoyshop

/**
 * 轮播图数据
 */
private void setBannerData() {
  //设置图片集合
  mBanner.setImages(images);
  //设置标题集合(当banner样式有显示title时)
  mBanner.setBannerTitles(titles);
  //设置指示器位置(当banner模式中有指示器时)
  mBanner.setIndicatorGravity(BannerConfig.CENTER);
  mBanner.start();
}

代码示例来源: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

@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);
}

代码示例来源:origin: Jerey-Jobs/KeepGank

@Override
protected void onBindViewHolder(@NonNull final BannerHolder holder, @NonNull final BannerBean
    item) {
  List<SubjectsBean> subjects = item.getSubjects();
  List<String> imageUrls = new ArrayList<>();
  List<String> titles = new ArrayList<>();
  for (SubjectsBean s : subjects) {
    imageUrls.add(s.getImages().getLarge());
    titles.add(s.getTitle());
  }
  holder.mItemBanner.setImages(imageUrls)
      .setBannerTitles(titles)
      .setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE)
      .setImageLoader(new GlideImageLoader())
      .start();
  holder.mItemBanner.setOnBannerListener(new OnBannerListener() {
    @Override
    public void OnBannerClick(int position) {
      ARouter.getInstance()
          .build("/douban/MovieActivity")
          .withTransition(R.anim.in_from_right, 0)
          .withString("movieId", item.getSubjects().get(position).getId())
          .navigation(holder.mItemBanner.getContext());
    }
  });
}

代码示例来源:origin: SunAlwaysOnline/Sukeda

banner.setBannerTitles(title);

代码示例来源:origin: SunAlwaysOnline/Sukeda

banner.setBannerTitles(title);

代码示例来源:origin: wzmyyj/ZYMK

@Override
protected void initView() {
  view = mInflater.inflate(R.layout.panel_banner, null);
  mBanner = view.findViewById(R.id.banner);
  List images = new ArrayList<>();
  List<String> titles = new ArrayList<>();
  setData(images, titles);
  //设置图片加载器
  mBanner.setImageLoader(getImageLoader());
  //设置图片集合
  mBanner.setImages(images);
  //设置banner动画效果
  mBanner.setBannerAnimation(Transformer.Accordion);
  //设置标题集合(当banner样式有显示title时)
  mBanner.setBannerTitles(titles);
  //设置自动轮播,默认为true
  mBanner.isAutoPlay(true);
  //设置轮播时间
  mBanner.setDelayTime(5000);
  //设置banner样式
  mBanner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE);
  //设置指示器位置(当banner模式中有指示器时)
  mBanner.setIndicatorGravity(BannerConfig.RIGHT);
  // 自定义样式
  setBanner(mBanner);
  //banner设置方法全部调用完毕时最后调用
  mBanner.start();
}

代码示例来源:origin: 6ag/BaoKanAndroid

.setImageLoader(new FrescoImageLoader())
.setImages(images)
.setBannerTitles(titles)
.isAutoPlay(true)
.setDelayTime(5000)

代码示例来源:origin: AdleyLong/RecyclerViewDemo

.setBannerTitles(titles)
.setImageLoader(new PicassoImageLoader())
.setImages(urls)

代码示例来源:origin: borneywpf/TLRLoadRefresh

mBanner.setBannerTitles(titles);

代码示例来源:origin: SunAlwaysOnline/Sukeda

private void initBanner() {
  banner = (Banner) findViewById(R.id.banner);
  //设置banner样式
  banner.setBannerStyle(BannerConfig.NUM_INDICATOR_TITLE);
  //设置图片加载器
  banner.setImageLoader(new GlideImageLoader());
  //设置图片集合
  List<String> title = LibraryPictureUtil.get_library_pic_title();
  List<String> url = LibraryPictureUtil.get_library_picture_url();
  banner.setImages(url);
  //设置banner动画效果
  banner.setBannerAnimation(Transformer.Default);
  //设置标题集合(当banner样式有显示title时)
  banner.setBannerTitles(title);
  //设置自动轮播,默认为true
  banner.isAutoPlay(true);
  //设置轮播时间
  banner.setDelayTime(3000);
  //设置指示器位置(当banner模式中有指示器时)
  banner.setIndicatorGravity(BannerConfig.CENTER);
  //banner设置方法全部调用完毕时最后调用
  banner.start();
}

相关文章