示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_main);
            mDemoSlider = FindViewById <SliderLayout>(Resource.Id.slider);

            var url_maps = new Dictionary <string, string>();

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

            var file_maps = new Dictionary <string, int>();

            file_maps.Add("Hannibal", Resource.Drawable.hannibal);
            file_maps.Add("Big Bang Theory", Resource.Drawable.bigbang);
            file_maps.Add("House of Cards", Resource.Drawable.house);
            file_maps.Add("Game of Thrones", Resource.Drawable.game_of_thrones);

            foreach (var name in file_maps.Keys)
            {
                TextSliderView textSliderView = new TextSliderView(this);
                // initialize a SliderLayout
                textSliderView
                .description(name)
                .image(file_maps[name])
                .setScaleType(ScaleType.Fit)
                .setOnSliderClickListener(this);

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

                mDemoSlider.addSlider(textSliderView);
            }
            mDemoSlider.SetPresetTransformer(Transformer.Accordion);
            mDemoSlider.SetPresetIndicator(PresetIndicators.Center_Bottom);
            mDemoSlider.CustomAnimation = (new DescriptionAnimation());
            mDemoSlider.Duration        = (4000);
            mDemoSlider.addOnPageChangeListener(this);
            ListView l = FindViewById <ListView>(Resource.Id.transformers);

            l.SetAdapter(new TransformerAdapter(this));
            l.OnItemClickListener = new ListViewOnClickItemListener(mDemoSlider, this);
        }
示例#2
0
 public ListViewOnClickItemListener(SliderLayout demoSlider, Context ctx)
 {
     mDemoSlider = demoSlider;
     _ctx        = ctx;
 }