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


Java SliderLayout.setCustomIndicator方法代码示例

本文整理汇总了Java中com.daimajia.slider.library.SliderLayout.setCustomIndicator方法的典型用法代码示例。如果您正苦于以下问题:Java SliderLayout.setCustomIndicator方法的具体用法?Java SliderLayout.setCustomIndicator怎么用?Java SliderLayout.setCustomIndicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.daimajia.slider.library.SliderLayout的用法示例。


在下文中一共展示了SliderLayout.setCustomIndicator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HeaderVH

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
public HeaderVH(View headerView) {
    super(headerView);
    mSlHeader = (SliderLayout) headerView.findViewById(R.id.sl_header);
    mPagerIndicator = (PagerIndicator) headerView.findViewById(R.id.pi_header);
    mSlHeader.setCustomIndicator(mPagerIndicator);
}
 
开发者ID:linhaosheng,项目名称:ZhihuDailyRRD,代码行数:7,代码来源:NewsListAdapter.java

示例2: setSlider

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
@BindingAdapter(value = {"indicator", "data", "sliderClick"}, requireAll = false)
public static void setSlider(SliderLayout sliderLayout, PagerIndicator indicator, String data,
                             BaseSliderView.OnSliderClickListener onSliderClickListener) {

    DisplayMetrics displayMetrics = AppContext.getInstance().getResources().getDisplayMetrics();
    float width = displayMetrics.widthPixels;
    ViewGroup.LayoutParams lp = sliderLayout.getLayoutParams();
    lp.height = (int) (166 * width / 375);
    sliderLayout.setLayoutParams(lp);
    sliderLayout.requestLayout();

    //清空旧的
    sliderLayout.removeAllSliders();
    List<String> banners = new ArrayList<>();
    banners.add("http://jewely-image.b0.upaiyun.com/images/2017-02-22/148773250858acff1c6b69f.jpg");
    banners.add("http://jewely-image.b0.upaiyun.com/images/2017-02-22/148774660958ad363167649.jpg");
    banners.add("http://jewely-image.b0.upaiyun.com/ueditor/2017-02-28/1488248833.jpg");
    banners.add("https://static.darryring.com/ueditor/2017-03-28/1490687105.jpg");
    for (String banner : banners) {
        DefaultSliderView defaultSliderView = new DefaultSliderView(AppContext.getInstance());
        defaultSliderView.image(banner).empty(R.drawable.bg_image_loading).error(R.drawable.bg_image_loading)
                .setScaleType(BaseSliderView.ScaleType.CenterCrop).setOnSliderClickListener(onSliderClickListener);
        defaultSliderView.bundle(new Bundle());
        defaultSliderView.getBundle().putSerializable("extra", banner);
        sliderLayout.addSlider(defaultSliderView);
    }

    indicator.setDefaultIndicatorColor(ContextCompat.getColor(AppContext.getInstance(), R.color.pagerIndicator_select_color),
            ContextCompat.getColor(AppContext.getInstance(), R.color.pagerIndicator_unSelect_color));
    sliderLayout.setCustomIndicator(indicator);
    sliderLayout.setCustomAnimation(new DescriptionAnimation());
    sliderLayout.setDuration(3 * 1000);
    sliderLayout.setRecoverCycleDuration(200);
    sliderLayout.startAutoCycle();
}
 
开发者ID:chenzj-king,项目名称:RvHelper,代码行数:36,代码来源:DataBindingAdapter.java

示例3: initSliderLayout

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
/**
 * 初始化SliderLayout
 */
private void initSliderLayout() {
    mSliderLayout = (SliderLayout) view.findViewById(R.id.slider);
    PagerIndicator indicator = (PagerIndicator) view.findViewById(R.id.custom_indicator);
    mSliderLayout.setCustomIndicator(indicator);
    mSliderLayout.setCustomAnimation(new DescriptionAnimation());
    mSliderLayout.setPresetTransformer(SliderLayout.Transformer.RotateUp);
    mSliderLayout.setDuration(3000);
}
 
开发者ID:bitkylin,项目名称:BitkyShop,代码行数:12,代码来源:HomeFragment.java

示例4: HeaderVH

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
public HeaderVH(View itemView) {
    super(itemView);
    mSlHeader = (SliderLayout) itemView.findViewById(R.id.sl_header);
    mPagerIndicator = (PagerIndicator) itemView.findViewById(R.id.pi_header);
    mSlHeader.setCustomIndicator(mPagerIndicator);
}
 
开发者ID:lsxiao,项目名称:ZhihuDailyFluxRRD,代码行数:7,代码来源:NewsListAdapter.java


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