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


Java PagerIndicator类代码示例

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


PagerIndicator类属于com.daimajia.slider.library.Indicators包,在下文中一共展示了PagerIndicator类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupCurrentImagesViewPager

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
private void setupCurrentImagesViewPager(ArrayList<String> productImages) {
        productImagesViewPager.removeAllSliders();
        ViewGroup.LayoutParams vp = productImagesViewPager.getLayoutParams();
        vp.height = (int) (DisplayArea.getDisplayWidth());
        productImagesViewPager.setLayoutParams(vp);
        for (String productImage : productImages) {
            DefaultSliderView sliderView = new DefaultSliderView(home);
            sliderView.image(productImage);
//            sliderView.setOnSliderClickListener(new BaseSliderView.OnSliderClickListener() {
//                @Override
//                public void onSliderClick(BaseSliderView slider) {
//                    home.showProductsFragment(Constants.PRODUCTS_MODE_BANNER, null);
//                }
//            });
            productImagesViewPager.addSlider(sliderView);
        }

        productImagesViewPager.setPresetTransformer(SliderLayout.Transformer.ZoomOutSlide);
        productImagesViewPager.setIndicatorVisibility(PagerIndicator.IndicatorVisibility.Invisible);
        productImagesViewPager.stopAutoCycle();
    }
 
开发者ID:vinsol-spree-contrib,项目名称:spree-android,代码行数:22,代码来源:ProductDetailFragment.java

示例2: onOptionsItemSelected

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()){
        case R.id.action_custom_indicator:
            mDemoSlider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));
            break;
        case R.id.action_custom_child_animation:
            mDemoSlider.setCustomAnimation(new ChildAnimationExample());
            break;
        case R.id.action_restore_default:
            mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
            mDemoSlider.setCustomAnimation(new DescriptionAnimation());
            break;
        case R.id.action_github:
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/daimajia/AndroidImageSlider"));
            startActivity(browserIntent);
            break;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:yaozs,项目名称:AndroidImageSlider-glide,代码行数:21,代码来源:MainActivity.java

示例3: setCustomIndicator

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
public void setCustomIndicator(PagerIndicator indicator){
    if(mIndicator != null){
        mIndicator.destroySelf();
    }
    mIndicator = indicator;
    mIndicator.setIndicatorVisibility(mIndicatorVisibility);
    mIndicator.setViewPager(mViewPager);
    mIndicator.redraw();
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:10,代码来源:SliderLayout.java

示例4: setIndicatorVisibility

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
/**
 * Set the visibility of the indicators.
 * @param visibility
 */
public void setIndicatorVisibility(PagerIndicator.IndicatorVisibility visibility){
    if(mIndicator == null){
        return;
    }

    mIndicator.setIndicatorVisibility(visibility);
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:12,代码来源:SliderLayout.java

示例5: getIndicatorVisibility

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
public PagerIndicator.IndicatorVisibility getIndicatorVisibility(){
    if(mIndicator == null){
        return mIndicator.getIndicatorVisibility();
    }
    return PagerIndicator.IndicatorVisibility.Invisible;

}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:8,代码来源:SliderLayout.java

示例6: setupCurrentOffersViewPager

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
private void setupCurrentOffersViewPager(ArrayList<Banner> currentOfferBanners) {
    ViewGroup.LayoutParams vp = currentOffersViewPager.getLayoutParams();
    vp.height = (int) (DisplayArea.getDisplayWidth()/1.72);
    currentOffersViewPager.setLayoutParams(vp);
    for (Banner currentOffer : currentOfferBanners) {
        DefaultSliderView sliderView = new DefaultSliderView(home);
        sliderView.image(currentOffer.getImage());
        sliderView.setOnSliderClickListener(new BaseSliderView.OnSliderClickListener() {
            @Override
            public void onSliderClick(BaseSliderView slider) {
                home.showProductsFragment(ProductsFragment.PRODUCTS_MODE_BANNER, null);
            }
        });
        currentOffersViewPager.addSlider(sliderView);
    }

    currentOffersViewPager.setPresetTransformer(SliderLayout.Transformer.ZoomOutSlide);
    currentOffersViewPager.setIndicatorVisibility(PagerIndicator.IndicatorVisibility.Invisible);
    currentOffersViewPager.stopAutoCycle();
}
 
开发者ID:vinsol-spree-contrib,项目名称:spree-android,代码行数:21,代码来源:DashboardFragment.java

示例7: HeaderVH

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的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

示例8: setSlider

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的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

示例9: initSliderLayout

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的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

示例10: setPresetIndicator

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
public void setPresetIndicator(PresetIndicators presetIndicator){
    PagerIndicator pagerIndicator = (PagerIndicator)findViewById(presetIndicator.getResourceId());
    setCustomIndicator(pagerIndicator);
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:5,代码来源:SliderLayout.java

示例11: HeaderVH

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的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

示例12: getPagerIndicator

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
/**
 * get the {@link PagerIndicator} instance.
 * You can manipulate the properties of the indicator.
 * @return
 */
public PagerIndicator getPagerIndicator(){
    return mIndicator;
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:9,代码来源:SliderLayout.java

示例13: getPagerIndicator

import com.daimajia.slider.library.Indicators.PagerIndicator; //导入依赖的package包/类
/**
 * get the {@link com.daimajia.slider.library.Indicators.PagerIndicator} instance.
 * You can manipulate the properties of the indicator.
 * @return
 */
public PagerIndicator getPagerIndicator(){
    return mIndicator;
}
 
开发者ID:yaozs,项目名称:AndroidImageSlider-glide,代码行数:9,代码来源:SliderLayout.java


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