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


Java DescriptionAnimation类代码示例

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


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

示例1: showHotelImages

import com.daimajia.slider.library.Animations.DescriptionAnimation; //导入依赖的package包/类
@Override
    public void showHotelImages(HashMap<String, String> file_maps) {
        for (String name : file_maps.keySet()) {
            FrescoSliderView textSliderView = new FrescoSliderView(getActivity());
            textSliderView
                    .image(file_maps.get(name))
                    .setScaleType(BaseSliderView.ScaleType.CenterCrop);
            textSliderView.bundle(new Bundle());
            textSliderView.setAction(DetailFragment.this);
            mDemoSlider.addSlider(textSliderView);
        }
//        mDemoSlider.stopAutoCycle();
        mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
        mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
        mDemoSlider.setCustomAnimation(new DescriptionAnimation());
        mDemoSlider.addOnPageChangeListener(this);
    }
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:18,代码来源:DetailFragment.java

示例2: imageSlider

import com.daimajia.slider.library.Animations.DescriptionAnimation; //导入依赖的package包/类
private void imageSlider(NewsModel result) {
    int sliderCount = (result.getPosts().size()%2 == 0) ?
            result.getPosts().size() / 2:
            result.getPosts().size() / 3;
    for (int i = 0; i < sliderCount; i++) {
        slidingImages.put(result.getPosts().get(i).getTitle(), result.getPosts().get(i).getThumbnail());
    }
    for(String name : slidingImages.keySet()){
        TextSliderView textSliderView = new TextSliderView(getContext());
        textSliderView
                .description(name)
                .image(slidingImages.get(name))
                .setScaleType(BaseSliderView.ScaleType.Fit);
        textSliderView.bundle(new Bundle());
        textSliderView.getBundle()
                .putString("extra", name);

        sliderMain.addSlider(textSliderView);
    }
    sliderMain.setPresetTransformer(SliderLayout.Transformer.Default);
    sliderMain.setPresetIndicator(SliderLayout.PresetIndicators.Center_Top);
    sliderMain.setCustomAnimation(new DescriptionAnimation());
    sliderMain.setDuration(4000);
}
 
开发者ID:daeng-id,项目名称:nfkita-mobile,代码行数:25,代码来源:HomeFragment.java

示例3: onOptionsItemSelected

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

示例4: onCreateView

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

示例5: setSlider

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

示例6: initSliderLayout

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

示例7: onCreateView

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

示例8: initSlider

import com.daimajia.slider.library.Animations.DescriptionAnimation; //导入依赖的package包/类
private void initSlider() {


        if (mBanner != null) {

            for (Banner banner : mBanner) {


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

            }
        }


        mSliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);

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


    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:HomeFragment.java

示例9: onSucces

import com.daimajia.slider.library.Animations.DescriptionAnimation; //导入依赖的package包/类
@Override
public void onSucces(JSONObject result) {

    progressDialog.hide();

    JSONArray jsonArray = null;
    try {
        JSONObject productObject = result.getJSONObject("product");

        productID = productObject.getInt("productID");
        int star = productObject.getInt("stars");
        String name = productObject.getString("name");
        String description = productObject.getString("description");
        price = productObject.getDouble("price");

        JSONArray imageArray = productObject.getJSONArray("images");

        tvPrice.setText(price+" TL");

            for (int j=0; j<imageArray.length(); j++){
                JSONObject imageObject = imageArray.getJSONObject(j);
                imageList.add(imageObject.getString("image"));
            }

            for (int k=0; k<imageList.size(); k++){
                TextSliderView textSliderView = new TextSliderView(getActivity());
                // initialize a SliderLayout
                textSliderView
                        .description(name)
                        .image(imageList.get(k))
                        .setScaleType(BaseSliderView.ScaleType.Fit)
                        .setOnSliderClickListener(this);

                sliderLayout.addSlider(textSliderView);
            }

            sliderLayout.setPresetTransformer(SliderLayout.Transformer.Accordion);
            sliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
            sliderLayout.setCustomAnimation(new DescriptionAnimation());
            sliderLayout.setDuration(3000);
            sliderLayout.addOnPageChangeListener(this);


    } catch (JSONException e) {
        e.printStackTrace();
    }
}
 
开发者ID:yusufcakal,项目名称:RestaurantApp,代码行数:48,代码来源:ProductDetailFragment.java

示例10: onCreate

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

示例11: onCreateView

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

示例12: initSlider

import com.daimajia.slider.library.Animations.DescriptionAnimation; //导入依赖的package包/类
private void initSlider(){




        if(mBanner !=null){

            for (Banner banner : mBanner){


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

            }
        }



        mSliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);

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




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

示例13: showSliderViews

import com.daimajia.slider.library.Animations.DescriptionAnimation; //导入依赖的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.Animations.DescriptionAnimation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。