当前位置: 首页>>代码示例>>Java>>正文


Java ConvenientBanner类代码示例

本文整理汇总了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);
}
 
开发者ID:v991314,项目名称:3DGameInfo,代码行数:18,代码来源:Chapter_adapter_banner.java

示例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);
}
 
开发者ID:remerber,项目名称:FastEc,代码行数:14,代码来源:LauncherScrollDelegate.java

示例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);

}
 
开发者ID:remerber,项目名称:FastEc,代码行数:14,代码来源:BannerCreator.java

示例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;
    }

}
 
开发者ID:remerber,项目名称:FastEc,代码行数:37,代码来源:MultipleRecyclerAdapter.java

示例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;
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:14,代码来源:DailyNewsAdapter.java

示例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);
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:15,代码来源:DailyNewsAdapter.java

示例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);
}
 
开发者ID:guxiaonian,项目名称:MeiLa_GNN,代码行数:11,代码来源:GoodFragment.java

示例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;
}
 
开发者ID:jenly1314,项目名称:KingTV,代码行数:13,代码来源:RecommendFragment.java

示例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);
    }
}
 
开发者ID:jenly1314,项目名称:KingTV,代码行数:16,代码来源:RecommendFragment.java

示例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);
        }
    }
}
 
开发者ID:v991314,项目名称:3DGameInfo,代码行数:15,代码来源:Chapter_adapter_banner.java

示例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);


}
 
开发者ID:qq137712630,项目名称:MeiZiNews,代码行数:10,代码来源:ZhiHuIView.java

示例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);
}
 
开发者ID:hanhailong,项目名称:DevHeadLine,代码行数:33,代码来源:HomeChoiceFragment.java

示例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);

}
 
开发者ID:anzaizai,项目名称:EasyRefreshLayout,代码行数:12,代码来源:OnlyRefreshActivity.java

示例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);
    }
}
 
开发者ID:10211509,项目名称:maketaobao,代码行数:16,代码来源:MainShopFragment.java

示例15: setLayout

import com.bigkoo.convenientbanner.ConvenientBanner; //导入依赖的package包/类
@Override
public Object setLayout() {
    mConventionBanner = new ConvenientBanner<>(getContext());
    return mConventionBanner;
}
 
开发者ID:remerber,项目名称:FastEc,代码行数:6,代码来源:LauncherScrollDelegate.java


注:本文中的com.bigkoo.convenientbanner.ConvenientBanner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。