本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}