cn.bingoogolapple.bgabanner.BGABanner Java Examples
The following examples show how to use
cn.bingoogolapple.bgabanner.BGABanner.
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: BgaAllActivity.java From AndroidAnimationExercise with Apache License 2.0 | 5 votes |
private View getHeadView() { View headView = View.inflate(mContext, R.layout.bag_banner_layout, null); mBGABanner = (BGABanner) headView.findViewById(R.id.banner); mBGABanner.setAdapter(this); mBGABanner.setDelegate(this); mBGABanner.setTransitionEffect(TransitionEffect.Default); return headView; }
Example #2
Source File: Header.java From PracticalRecyclerView with Apache License 2.0 | 5 votes |
@Override public void onBind() { mBanner.setAdapter(new BGABanner.Adapter() { @Override public void fillBannerItem(BGABanner banner, View view, Object model, int position) { ((ImageView) view).setImageResource((int) model); } }); mBanner.setData(Arrays.asList(R.mipmap.a, R.mipmap.b, R.mipmap.c, R.mipmap.d, R.mipmap.e, R.mipmap.f, R.mipmap.g, R.mipmap.h), null); }
Example #3
Source File: LiveFragment.java From LQRBiliBlili with MIT License | 4 votes |
@Override public void setBanner(BGABanner.Adapter<ImageView, String> adapter, List<String> banners) { mBanner.setAdapter(adapter); mBanner.setData(banners, banners); }
Example #4
Source File: RecommendMultiItemAdapter.java From LQRBiliBlili with MIT License | 4 votes |
@Override public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) { mAppComponent.imageLoader().loadImage(mContext, ImageConfigImpl.builder().imageView(itemView).url(model).build()); }
Example #5
Source File: RecommendMultiItemAdapter.java From LQRBiliBlili with MIT License | 4 votes |
@Override protected void convert(BaseViewHolder helper, RecommendMultiItem item) { if (mAppComponent == null) { mAppComponent = ArmsUtils.obtainAppComponentFromContext(mContext); } IndexData.DataBean itemBean = item.getIndexDataBean(); switch (item.getItemType()) { case RecommendMultiItem.BANNER: BGABanner banner = helper.getView(R.id.banner); List<IndexData.DataBean.BannerItemBean> banners = itemBean.getBanner_item(); List<String> images = new ArrayList<>(); if (banners != null && banners.size() > 0) { for (int i = 0; i < banners.size(); i++) { IndexData.DataBean.BannerItemBean bannerItem = banners.get(i); images.add(bannerItem.getImage()); } } banner.setAdapter(mBannerAdapter); banner.setData(images, images); break; case RecommendMultiItem.STREAMER: mAppComponent.imageLoader().loadImage(mContext, ImageConfigImpl.builder().imageView(helper.getView(R.id.iv_streamer)).url(itemBean.getCover()).build()); helper.setText(R.id.tv_item_title, itemBean.getTitle()) .setText(R.id.tv_badge, TextUtils.isEmpty(itemBean.getBadge()) ? ("topic".equals(itemBean.getGotoX()) ? "话题" : "") : itemBean.getBadge()) .setText(R.id.tv_desc, itemBean.getDesc()); break; case RecommendMultiItem.ITEM_AV: setItemPaddingAndImage(helper, item, itemBean); helper.setText(R.id.tv_play, TextHandleUtil.handleCount2TenThousand(itemBean.getPlay())) .setText(R.id.tv_danmaku, TextHandleUtil.handleCount2TenThousand(itemBean.getDanmaku())) .setText(R.id.tv_duration, TextHandleUtil.handleDurationSecond(itemBean.getDuration())) .setText(R.id.tv_title, itemBean.getTitle()) .setText(R.id.tv_tname_tag_name, itemBean.getTname() + "‧" + (itemBean.getTag() == null ? "" : itemBean.getTag().getTag_name())); break; case RecommendMultiItem.ITEM_AV_RCMD_REASON: setItemPaddingAndImage(helper, item, itemBean); helper.setText(R.id.tv_play, TextHandleUtil.handleCount2TenThousand(itemBean.getPlay())) .setText(R.id.tv_danmaku, TextHandleUtil.handleCount2TenThousand(itemBean.getDanmaku())) .setText(R.id.tv_duration, TextHandleUtil.handleDurationSecond(itemBean.getDuration())) .setText(R.id.tv_title, itemBean.getTitle()) .setText(R.id.tv_rcmd_reason, itemBean.getRcmd_reason().getContent()); break; case RecommendMultiItem.ITEM_BANGUMI: setItemPaddingAndImage(helper, item, itemBean); helper.setText(R.id.tv_play, TextHandleUtil.handleCount2TenThousand(itemBean.getPlay())) .setText(R.id.tv_favorite, itemBean.getFavorite() + "") .setText(R.id.tv_title, itemBean.getTitle()) .setText(R.id.tv_last_index, mContext.getResources().getString(R.string.recommend_home_update_to_last_index, itemBean.getLast_index())) .setText(R.id.tv_badge, itemBean.getBadge()); break; case RecommendMultiItem.ITEM_LOGIN: break; case RecommendMultiItem.ITEM_AD_WEB_S: setItemPaddingAndImage(helper, item, itemBean); helper.setText(R.id.tv_title, itemBean.getTitle()) .setText(R.id.tv_desc, itemBean.getDesc()); break; case RecommendMultiItem.ITEM_ARTICLE_S: setItemPaddingAndImage(helper, item, itemBean); helper.setText(R.id.tv_play, TextHandleUtil.handleCount2TenThousand(itemBean.getPlay())) .setText(R.id.tv_favorite, itemBean.getFavorite() + "") .setText(R.id.tv_title, itemBean.getTitle()) .setText(R.id.tv_desc, itemBean.getDesc()); break; case RecommendMultiItem.PRE_HERE_CLICK_TO_REFRESH: break; } }
Example #6
Source File: BgaAllActivity.java From AndroidAnimationExercise with Apache License 2.0 | 4 votes |
@Override public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) { Glide.with(mContext) .load(model) .into(itemView); }
Example #7
Source File: BgaAllActivity.java From AndroidAnimationExercise with Apache License 2.0 | 4 votes |
@Override public void onBannerItemClick(BGABanner banner, ImageView itemView, String model, int position) { TT.showSToast(mContext, "you click " + (position + 1)); }
Example #8
Source File: LiveContract.java From LQRBiliBlili with MIT License | votes |
void setBanner(BGABanner.Adapter<ImageView, String> adapter, List<String> banners);