本文整理汇总了Java中com.bigkoo.convenientbanner.ConvenientBanner类的典型用法代码示例。如果您正苦于以下问题:Java ConvenientBanner类的具体用法?Java ConvenientBanner怎么用?Java ConvenientBanner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConvenientBanner类属于com.bigkoo.convenientbanner包,在下文中一共展示了ConvenientBanner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTypeBanner
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
private void setTypeBanner(MyViewHolder myViewHolder) {
//以属性动画的形式放大
ViewPropertyAnimator.animate(myViewHolder.itemView).scaleX(1).setDuration(350).start();
ViewPropertyAnimator.animate(myViewHolder.itemView).scaleY(1).setDuration(350).start();
//自定义你的Holder,实现更多复杂的界面,不一定是图片翻页,其他任何控件翻页亦可。
myViewHolder.mConvenientBanner.setPages(
new CBViewHolderCreator<LocalImageHolderView>() {
@Override
public LocalImageHolderView createHolder() {
return new LocalImageHolderView();
}
}, mLocalImages)
//设置两个点图片作为翻页指示器,不设置则没有指示器,可以根据自己需求自行配合自己的指示器,不需要圆点指示器可用不设
.setPageIndicator(new int[]{R.drawable.page_switch_normal, R.drawable.page_switch_checked})
//设置指示器的方向
.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL);
}
示例2: initBanner
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
private void initBanner() {
INTEGERS.add(R.mipmap.launcher_01);
INTEGERS.add(R.mipmap.launcher_02);
INTEGERS.add(R.mipmap.launcher_03);
INTEGERS.add(R.mipmap.launcher_04);
INTEGERS.add(R.mipmap.launcher_05);
mConventionBanner.setPages(new LaucherHolderCreator(), INTEGERS)
.setPageIndicator(new int[]{R.drawable.dot_normal, R.drawable.dot_focus})
.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL)
.setOnItemClickListener(this)
.setCanLoop(false);
}
示例3: setDefault
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
public static void setDefault(ConvenientBanner<String> convenientBanner,
ArrayList<String> banners,
OnItemClickListener clickListener) {
convenientBanner
.setPages(new HolderCreator(), banners)
.setPageIndicator(new int[]{R.drawable.dot_normal, R.drawable.dot_focus})
.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL)
.setOnItemClickListener(clickListener)
.startTurning(3000)
.setCanLoop(true);
}
示例4: convert
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
protected void convert(MultipleViewHolder holder, MultipleItemEntity entity) {
final String text;
final String imageUrl;
final ArrayList<String> bannerImages;
switch (holder.getItemViewType()) {
case ItemType.TEXT:
text = entity.getField(MultipleFields.TEXT);
holder.setText(R.id.text_single, text);
break;
case ItemType.IMAGE:
imageUrl = entity.getField(MultipleFields.IMAGE_URL);
Glide.with(mContext).load(imageUrl).diskCacheStrategy(DiskCacheStrategy.ALL)
.dontAnimate().centerCrop().into((ImageView) holder.getView(R.id.img_single));
break;
case ItemType.TEXT_IMAGE:
text = entity.getField(MultipleFields.TEXT);
imageUrl = entity.getField(MultipleFields.IMAGE_URL);
Glide.with(mContext).load(imageUrl).diskCacheStrategy(DiskCacheStrategy.ALL)
.dontAnimate().centerCrop().into((ImageView) holder.getView(R.id.img_multiple));
holder.setText(R.id.tv_multiple, text);
break;
case ItemType.BANNER:
if (!mIsInitBanner) {
bannerImages = entity.getField(MultipleFields.BANNERS);
final ConvenientBanner<String> convenientBanner = holder.getView(R.id.banner_recycler_item);
BannerCreator.setDefault(convenientBanner, bannerImages, this);
mIsInitBanner = true;
}
break;
default:
break;
}
}
示例5: onCreateViewHolder
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == ITEM_TYPE_CONTENT) {
return new ContentViewHolder(getCreatedView(parent, R.layout.list_item_common));
} else if (viewType == ITEM_TYPE_HEADER) {
View header = getCreatedView(parent, R.layout.header_item);
mBanner = (ConvenientBanner) header.findViewById(R.id.convenientBanner);
return new HeaderViewHolder(header);
} else if (viewType == ITEM_TYPE_BOTTOM) {
return new BottomViewHolder(getCreatedView(parent, R.layout.footer_item));
}
return null;
}
示例6: onBindData2View
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public void onBindData2View(List<TopStoriesBean> data) {
convenientBanner
.setPages(new CBViewHolderCreator<NetworkImageHolderView>() {
@Override
public NetworkImageHolderView createHolder() {
return new NetworkImageHolderView();
}
}, data)
.setPageIndicator(new int[]{R.drawable.ic_page_indicator,
R.drawable.ic_page_indicator_focused})
.setPageTransformer(ConvenientBanner.Transformer.AccordionTransformer)
.startTurning(5000);
}
示例7: HeadViewHolder
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
public HeadViewHolder() {
view = LayoutInflater.from(getContext()).inflate(R.layout.recomment_item_head, null);
ButterKnife.bind(this, view);
banner.setPages(this, banners)
.setPageIndicator(new int[]{R.drawable.shape_dot_normal, R.drawable.shape_dot_sel})
.setOnItemClickListener(this)
.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL)
.setManualPageable(true);
}
示例8: onCreateView
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public View onCreateView(ViewGroup parent) {
View v = LayoutInflater.from(context).inflate(R.layout.banner,null);
convenientBanner = (ConvenientBanner)v.findViewById(R.id.convenientBanner);
convenientBanner.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(int position) {
clickBannerItem(listBanner.get(position));
}
});
return v;
}
示例9: onBindView
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public void onBindView(View headerView) {
convenientBanner.setPages(new CBViewHolderCreator() {
@Override
public Holder<Banner> createHolder() {
return new ImageHolder();
}
},listBanner)
.setPageIndicator(new int[]{R.drawable.ic_dot_normal,R.drawable.ic_dot_pressed})
.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL);
if(!convenientBanner.isTurning()){
convenientBanner.startTurning(4000);
}
}
示例10: MyViewHolder
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
public MyViewHolder(View itemView, int viewType) {
super(itemView);
if (viewType == TYPE_NORMAL) {
pic_ImageView = (ImageView) itemView.findViewById(R.id.pic_ImageView);
title_TextView = (TextView) itemView.findViewById(R.id.title_TextView);
date_TextView = (TextView) itemView.findViewById(R.id.date_TextView);
comment_TextView = (TextView) itemView.findViewById(R.id.comment_TextView);
} else {
mConvenientBanner = (ConvenientBanner) itemView.findViewById(R.id.convenientBanner);
if (onItemClickListener != null) {
onItemClickListener.onFindBannerFinshed(mConvenientBanner);
}
}
}
示例11: initBanner
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
private void initBanner(RecyclerView recycler_list) {
View header = LayoutInflater.from(recycler_list.getContext()).inflate(R.layout.fragment_news_banner, recycler_list, false);
banner = (ConvenientBanner) header.findViewById(R.id.convenientBanner);
banner.setScrollDuration(1000);
banner.startTurning(5000);
zhiHuAdapter.setHeaderView(header);
}
示例12: init
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
protected void init(View view) {
mBannerV = (ConvenientBanner) View.inflate(getActivity(), R.layout.view_home_banner, null);
mRecyclerView.addHeaderView(mBannerV);
mAdapter = new HomeChoiceAdapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
//TODO
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//TODO
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mSwipeRefreshLayout.setRefreshing(false);
}
}, 2000);
}
});
mPresenter.loadBanners();
mPresenter.loadArticleDataList();
mSwipeRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
mSwipeRefreshLayout.setRefreshing(true);
}
}, 100);
}
示例13: initView
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
private void initView() {
easyRefreshLayout = (EasyRefreshLayout) findViewById(R.id.easylayout);
recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
adapter = new SimpleAdapter();
recyclerView.setAdapter(adapter);
banner = (ConvenientBanner) View.inflate(this, R.layout.convenientbanner_view, null);
}
示例14: showAndRunAdsBanner
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public void showAndRunAdsBanner(List<String> imgUrls, int period) {
if (bannerMain != null) {
bannerMain.setPages(
new CBViewHolderCreator<ImageViewHolder>() {
@Override
public ImageViewHolder createHolder() {
return new ImageViewHolder();
}
}, imgUrls)
.setPageIndicator(new int[]{R.drawable.ic_banner_indicator, R.drawable.ic_banner_indicator_focus})
.setPageTransformer(ConvenientBanner.Transformer.DefaultTransformer);
bannerMain.startTurning(period);
}
}
示例15: setLayout
import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public Object setLayout() {
mConventionBanner = new ConvenientBanner<>(getContext());
return mConventionBanner;
}