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


Java DefaultSliderView类代码示例

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


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

示例1: setupCurrentImagesViewPager

import com.daimajia.slider.library.SliderTypes.DefaultSliderView; //导入依赖的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: initListView

import com.daimajia.slider.library.SliderTypes.DefaultSliderView; //导入依赖的package包/类
/**
 * {@link ListView} initialize
 */
private void initListView() {
    ListView listView = (ListView) findViewById(R.id.list_view);
    View headerLayout = LayoutInflater.from(this)
            .inflate(R.layout.layout_viewpager, null);
    SliderLayout sliderLayout = (SliderLayout) headerLayout.findViewById(R.id.slider);

    for (int resId : mPagerDatas) {
        DefaultSliderView mSliderView = new DefaultSliderView(this);
        mSliderView
                .image(resId)
                .setScaleType(BaseSliderView.ScaleType.Fit);
        mSliderView.bundle(new Bundle());
        mSliderView.getBundle().putInt("position", mPagerDatas.indexOf(resId));
        sliderLayout.addSlider(mSliderView);
    }

    sliderLayout.setPresetTransformer(SliderLayout.Transformer.Default);
    sliderLayout.setDuration(3000);
    ListAdapter adapter = new ListAdapter(this, R.layout.list_item, mSampleDatas);
    adapter.setViewPager(sliderLayout);
    listView.setAdapter(adapter);
}
 
开发者ID:lubeast,项目名称:AlphaLayout,代码行数:26,代码来源:ListSampleActivity.java

示例3: setupCurrentOffersViewPager

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

示例4: setSlider

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

示例5: loadCameraImages

import com.daimajia.slider.library.SliderTypes.DefaultSliderView; //导入依赖的package包/类
private void loadCameraImages() {
    final int CAMERA_IMAGE_COUNT = 9;

    if (mCameraSliderLayout == null) {
        return;
    }

    mCameraSliderLayout.stopAutoCycle();
    mCameraSliderLayout.removeAllSliders();

    for (int i = 1; i < CAMERA_IMAGE_COUNT+1; i++) {
        if (i == 5) {
            // Skip 5 for now cuz its not loading for some werid reason
            continue;
        }

        String cameraURL = mCamera.getImageUrl().replace("01.jpg", String.format(Locale.US, "%02d.jpg", i));
        Ion.with(getActivity()).load(cameraURL).asBitmap().setCallback(new FutureCallback<Bitmap>() {
            @Override
            public void onCompleted(Exception e, Bitmap result) {
                DefaultSliderView cameraSliderView = new DefaultSliderView(getActivity());
                cameraSliderView.image(result);
                mCameraSliderLayout.addSlider(cameraSliderView);
            }
        });
    }
}
 
开发者ID:mpiannucci,项目名称:HackWinds-Android,代码行数:28,代码来源:CurrentFragment.java

示例6: showSliderViews

import com.daimajia.slider.library.SliderTypes.DefaultSliderView; //导入依赖的package包/类
private void showSliderViews(List<Banner> banners){




        if(banners !=null){

            for (Banner banner : banners){


                DefaultSliderView sliderView = new DefaultSliderView(this.getActivity());
                sliderView.image(banner.getImgUrl());
                sliderView.description(banner.getName());
                sliderView.setScaleType(BaseSliderView.ScaleType.Fit);
                mSliderLayout.addSlider(sliderView);

            }
        }



        mSliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);

        mSliderLayout.setCustomAnimation(new DescriptionAnimation());
        mSliderLayout.setPresetTransformer(SliderLayout.Transformer.Default);
        mSliderLayout.setDuration(3000);




    }
 
开发者ID:zzlnewair,项目名称:Myshop,代码行数:32,代码来源:CategoryFragment.java


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