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


Java SliderLayout.setCustomAnimation方法代码示例

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


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

示例1: onCreateView

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
@Override
    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_project, container, false);
        // Inflate the layout for this fragment
        mDemoSlider = (SliderLayout) view.findViewById(R.id.slider);
        simpleList = (GridView) view.findViewById(R.id.simpleGridView);

        mHandler = new Handler(Looper.getMainLooper()); // udaan hurdanii shalgax davtalt

        HashMap<String,String> url_maps = new HashMap<String, String>();
        url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://www.colourbox.com/preview/1282705-colorful-child-hand-prints-on-white-background.jpg");
        url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://image.freepik.com/free-vector/fantastic-background-of-children-playing-together_23-2147608068.jpg");
        url_maps.put("Өсвөр үеийн эрүүл ирээдүйн төлөө", "https://ak2.picdn.net/shutterstock/videos/14967505/thumb/1.jpg");

        for(String name : url_maps.keySet()){

            TextSliderView textSliderView = new TextSliderView(getActivity());
            // initialize a SliderLayout
            textSliderView
                    .description(name)
                    .image(url_maps.get(name))
                    .setScaleType(BaseSliderView.ScaleType.Fit);
//                    .setOnSliderClickListener(getContext());

            //add your extra information
            textSliderView.bundle(new Bundle());
            textSliderView.getBundle()
                    .putString("extra",name);

            mDemoSlider.addSlider(textSliderView);

        }
        mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
        mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
        mDemoSlider.setCustomAnimation(new DescriptionAnimation());
        mDemoSlider.setDuration(4000);

        simpleList.setNumColumns(2);
        simpleList.setVisibility(View.VISIBLE);

        getProject();

        return view;

    }
 
开发者ID:doljko,项目名称:youth-health,代码行数:47,代码来源:ProjectFragment.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: onCreateView

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_apropos, container, false);

    mDemoSlider = (SliderLayout)rootView.findViewById(R.id.slider);

    HashMap<String,Integer> file_maps = new HashMap<String, Integer>();
    file_maps.put("About",R.drawable.apropos);
    file_maps.put("GDG Miage Gi", R.drawable.devfest);
    file_maps.put("Adidas...", R.drawable.football);

    for(String name : file_maps.keySet()){
        TextSliderView textSliderView = new TextSliderView(getActivity());
        // initialize a SliderLayout
        textSliderView
                .description(name)
                .image(file_maps.get(name))
                .setScaleType(BaseSliderView.ScaleType.Fit)
                .setOnSliderClickListener(this);

        //add your extra information
        textSliderView.getBundle()
                .putString("extra",name);

        mDemoSlider.addSlider(textSliderView);
    }
    mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Fade);
    mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
    mDemoSlider.setCustomAnimation(new DescriptionAnimation());
    mDemoSlider.setDuration(4000);
    return rootView;
}
 
开发者ID:GDGMiageGiLab,项目名称:CAN-2015,代码行数:34,代码来源:AproposFragment.java

示例5: onCreate

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.setDrawerListener(toggle);
        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

        homeItemList = (GridView)findViewById(R.id.homeItemList);
        prgLoading = (ProgressBar) findViewById(R.id.homeLoading);
        txtAlert = (TextView) findViewById(R.id.homeTxtAlert);

        NewsAPI = HackConstants.AllNewsApi +"?accesskey="+HackConstants.AccessKey;

        Intent iGet = getIntent();

        homeNewsAdapter = new HomeNewsAdapter(MainActivity.this);

        getSupportActionBar().setTitle(Category_name);

        new getDataTask().execute();

        homeNewsAdapter = new HomeNewsAdapter(this);

        homeItemList.setNumColumns(2);

        homeItemList.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            public void onItemClick(AdapterView<?> arg0, View arg1, int position,
                                    long arg3) {

                Intent iDetail = new Intent(getApplicationContext(), NewsDetailActivity.class);
                iDetail.putExtra("product_id", News_ID.get(position));
                startActivity(iDetail);
            }
        });

        //slider

        homeSlider = (SliderLayout)findViewById(R.id.slider);

        HashMap<String,String> url_maps = new HashMap<String, String>();
        url_maps.put("Hannibal", "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
        url_maps.put("Big Bang Theory", "http://tvfiles.alphacoders.com/100/hdclearart-10.png");
        url_maps.put("House of Cards", "http://cdn3.nflximg.net/images/3093/2043093.jpg");
        url_maps.put("Game of Thrones", "http://images.boomsbeat.com/data/images/full/19640/game-of-thrones-season-4-jpg.jpg");

        for(String name : url_maps.keySet()){
            TextSliderView textSliderView = new TextSliderView(this);
            // initialize a SliderLayout
            textSliderView
                    .description(name)
                    .image(url_maps.get(name))
                    .setScaleType(BaseSliderView.ScaleType.Fit);
//                    .setOnSliderClickListener(this);

            //add your extra information
            textSliderView.bundle(new Bundle());
            textSliderView.getBundle()
                    .putString("extra",name);

            homeSlider.addSlider(textSliderView);
        }
        homeSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
        homeSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
        homeSlider.setCustomAnimation(new DescriptionAnimation());
        homeSlider.setDuration(4000);
//        homeSlider.addOnPageChangeListener((ViewPagerEx.OnPageChangeListener) this);

    }
 
开发者ID:tortuvshin,项目名称:health,代码行数:80,代码来源:MainActivity.java

示例6: onCreateView

import com.daimajia.slider.library.SliderLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_home, container, false);
    // Inflate the layout for this fragment
    initUI(rootView);

    mDemoSlider = (SliderLayout)rootView.findViewById(R.id.slider);

    HashMap<String,String> url_maps = new HashMap<String, String>();
    url_maps.put("Hannibal", "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
    url_maps.put("Big Bang Theory", "http://tvfiles.alphacoders.com/100/hdclearart-10.png");
    url_maps.put("House of Cards", "http://cdn3.nflximg.net/images/3093/2043093.jpg");
    url_maps.put("Game of Thrones", "http://images.boomsbeat.com/data/images/full/19640/game-of-thrones-season-4-jpg.jpg");

    HashMap<String,Integer> file_maps = new HashMap<String, Integer>();
    file_maps.put("Tous contre EBOLA",R.drawable.ivoirien);
    file_maps.put("Champion d'afrique 2013",R.drawable.nigeria);
    file_maps.put("l'Algerie, un favorie...",R.drawable.algeri);
    file_maps.put("la CAF", R.drawable.slide1);
    file_maps.put("Eliminatoires ....", R.drawable.slide2);
    file_maps.put("Ballon officiel de la CAN 2015", R.drawable.ballon);
    file_maps.put("Adidas...", R.drawable.football);

    for(String name : file_maps.keySet()){
        TextSliderView textSliderView = new TextSliderView(getActivity());
        // initialize a SliderLayout
        textSliderView
                .description(name)
                .image(file_maps.get(name))
                .setScaleType(BaseSliderView.ScaleType.Fit)
                .setOnSliderClickListener(this);

        //add your extra information
        textSliderView.getBundle()
                .putString("extra",name);

        mDemoSlider.addSlider(textSliderView);
    }
    mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
    mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
    mDemoSlider.setCustomAnimation(new DescriptionAnimation());
    mDemoSlider.setDuration(4000);
    return rootView;
}
 
开发者ID:GDGMiageGiLab,项目名称:CAN-2015,代码行数:46,代码来源:HomeFragment.java


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