com.youth.banner.loader.ImageLoader Java Examples
The following examples show how to use
com.youth.banner.loader.ImageLoader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecommendFragment.java From AndroidSkinAnimator with MIT License | 6 votes |
private void loadBannerAd() { mBannerImages.clear(); for (int i = 0; i < BANNER_IMAGES.length; i++) { mBannerImages.add(BANNER_IMAGES[i]); } mHeaderBinding.banner .setDelayTime(5000) .setImages(mBannerImages) .setImageLoader(new ImageLoader() { @Override public void displayImage(Context context, Object path, ImageView imageView) { Glide.with(context).load(path) .crossFade(1000) .into(imageView); } }).start(); }
Example #2
Source File: HomeAdapter.java From playa with MIT License | 5 votes |
@Override public void bind() { bannerView.setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE); bannerView.setImageLoader(new ImageLoader() { @Override public void displayImage(Context context, Object path, ImageView imageView) { Glide.with(context).load(path).into(imageView); } }); List<String> bannerImageList = new ArrayList<>(); final List<String> bannerTitleList = new ArrayList<>(); final List<String> bannerUrlList = new ArrayList<>(); for (Banner banner : bannerData) { bannerImageList.add(banner.getImagePath()); bannerTitleList.add(banner.getTitle()); bannerUrlList.add(banner.getUrl()); } bannerView.setImages(bannerImageList); bannerView.setBannerTitles(bannerTitleList); bannerView.isAutoPlay(true); bannerView.setIndicatorGravity(BannerConfig.RIGHT); bannerView.setDelayTime(5000); bannerView.setOnBannerListener(new OnBannerListener() { @Override public void OnBannerClick(int position) { Intent intent = new Intent(itemView.getContext(), BrowserActivity.class); intent.putExtra("URL", bannerUrlList.get(position)); intent.putExtra("TITLE", bannerTitleList.get(position)); itemView.getContext().startActivity(intent); } }); bannerView.start(); }
Example #3
Source File: HomeFragment2.java From iMoney with Apache License 2.0 | 4 votes |
@Override protected void initData(String content) { if (!TextUtils.isEmpty(content)) { // 1.使用fastJson解析数据,并封装数据到java对象中 JSONObject jsonObject = JSON.parseObject(content); String proInfo = jsonObject.getString("proInfo"); Product product = JSON.parseObject(proInfo, Product.class); String imageArr = jsonObject.getString("imageArr"); List<Image> images = JSON.parseArray(imageArr, Image.class); index = new Index(); index.product = product; index.images = images; // 2.设置Banner,加载显示图片 // 设置banner样式 banner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE); // 设置图片加载器 banner.setImageLoader(new ImageLoader() { @Override public void displayImage(Context context, Object path, ImageView imageView) { // Picasso加载图片简单用法 Picasso.with(context).load((String) path).into(imageView); } }); // 设置图片url集合:imageUrl List<String> imageUrl = new ArrayList<String>(images.size()); for (int i = 0; i < images.size(); i++) { imageUrl.add(images.get(i).IMAURL); Log.e("TAG", "url = " + images.get(i).IMAURL); } banner.setImages(imageUrl); // 设置banner动画效果 banner.setBannerAnimation(Transformer.ZoomOutSlide); // DepthPage // 设置标题集合(当banner样式有显示title时) String[] titles = new String[]{"深情不及久伴,加息2%", "乐享活计划", "破茧重生", "安心钱包计划"}; banner.setBannerTitles(Arrays.asList(titles)); // 设置自动轮播,默认为true banner.isAutoPlay(true); // 设置轮播时间 banner.setDelayTime(3000); // 设置指示器位置(当banner模式中有指示器时) banner.setIndicatorGravity(BannerConfig.RIGHT); // banner设置方法全部调用完毕时最后调用 banner.start(); // 3.根据得到的产品的数据,更新界面中的产品展示 String yearRate = index.product.yearRate; tvHomeRate.setText(yearRate + "%"); currentProgress = Integer.parseInt(index.product.progress); new Thread(runnable).start(); } }