Ejemplo n.º 1
0
        public Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            Context con = context;
            List <SfRotatorItem> images  = new List <SfRotatorItem>();
            List <int>           imageID = new List <int>();

            SamplPageContent(con);

            /***********
            **Rotator**
            ***********/
            rotator = new SfRotator(con);
            rotator.LayoutParameters        = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, height / 2);//ActionBar.LayoutParameters(ViewGroup.LayoutParams.MATCH_PARENT,height/2);
            rotator.NavigationStripMode     = NavigationStripMode.Dots;
            rotator.NavigationDirection     = NavigationDirection.Horizontal;
            rotator.NavigationStripPosition = NavigationStripPosition.Bottom;
            rotator.SelectedIndex           = 2;
            rotator.EnableAutoPlay          = false;
            rotator.SetBackgroundColor(Color.ParseColor("#ececec"));

            //Images Id List
            imageID.Add(Resource.Drawable.movie1);
            imageID.Add(Resource.Drawable.movie2);
            imageID.Add(Resource.Drawable.movie3);
            imageID.Add(Resource.Drawable.movie4);
            imageID.Add(Resource.Drawable.movie5);
            SfRotatorItem item;
            ImageView     image;

            for (int i = 0; i < imageID.Count; i++)
            {
                item  = new SfRotatorItem(con);
                image = new ImageView(con);
                image.SetImageResource(imageID[i]);
                image.SetScaleType(ImageView.ScaleType.FitXy);
                item.Content = image;
                images.Add(item);
            }
            rotator.DataSource = images;

            //Main View
            LinearLayout mainView = new LinearLayout(con);

            mainView.AddView(GetView(con));

            return(mainView);
        }
Ejemplo n.º 2
0
        public override View GetSampleContent(Android.Content.Context context1)
        {
            con     = context1;
            context = context1;
            InitialMethod();

            //Rotator
            rotator = new SfRotator(con);
            rotator.LayoutParameters        = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, height / 2);//ActionBar.LayoutParameters(ViewGroup.LayoutParams.MATCH_PARENT,height/2);
            rotator.NavigationStripMode     = NavigationStripMode.Dots;
            rotator.NavigationDirection     = NavigationDirection.Horizontal;
            rotator.NavigationStripPosition = NavigationStripPosition.Bottom;
            rotator.SelectedIndex           = 2;
            rotator.EnableAutoPlay          = false;
            rotator.SetBackgroundColor(Color.ParseColor("#ececec"));

            //Images List
            List <SfRotatorItem> images = new List <SfRotatorItem>();

            //Images Id List
            List <int> imageID = new List <int>();

            imageID.Add(Resource.Drawable.movie1);
            imageID.Add(Resource.Drawable.movie2);
            imageID.Add(Resource.Drawable.movie3);
            imageID.Add(Resource.Drawable.movie4);
            imageID.Add(Resource.Drawable.movie5);
            SfRotatorItem item;
            ImageView     image;

            for (int i = 0; i < imageID.Count; i++)
            {
                item  = new SfRotatorItem(con);
                image = new ImageView(con);
                image.SetImageResource(imageID[i]);
                item.Content = image;
                images.Add(item);
            }
            rotator.DataSource = images;
            FinalLayout();

            return(frame);
        }