Exemplo n.º 1
0
        // Create the tree page for the given position:
        public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
        {
            // Instantiate the ImageView and give it an image:



            var    imageView    = new ImageView(context);
            string dbPath_Photo = System.IO.Path.Combine(Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).ToString(), "App4_Photo.db");
            var    db_Photo     = new SQLiteConnection(dbPath_Photo);

            //スライドごとに撮った画像を表示
            var A = db_Photo.Query <Photo>("SELECT * FROM Items WHERE _id = ?", position);

            foreach (var s in A)
            {
                bmp = BitmapFactory.DecodeFile(s.Path_Photo);
                imageView.SetImageBitmap(bmp);
                bmp = null;
                GC.Collect();
            }

            // Add the image to the ViewPager:
            var viewPager = container.JavaCast <ViewPager>();

            viewPager.AddView(imageView);

            return(imageView);
        }
        public override Java.Lang.Object InstantiateItem(ViewGroup containter, int position)
        {
            var imageView = new ImageView(mContext);

            imageView.SetImageResource(sliderImageId[position]);
            var viewPager = containter.JavaCast <ViewPager>();

            viewPager.AddView(imageView);
            return(imageView);
        }
Exemplo n.º 3
0
        public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
        {
            var imageView = new ImageView(context);

            imageView.SetImageResource(treeCatalog[position].imageId);
            var viewPager = container.JavaCast <ViewPager>();

            viewPager.AddView(imageView);
            viewPager.AddOnPageChangeListener(new CircularViewPagerHandler(viewPager));
            return(imageView);
        }
Exemplo n.º 4
0
        public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
        {
            var onboardingPage = LayoutInflater.From(container.Context).Inflate(
                Resource.Layout.onboarding_page, container, false);

            var image   = onboardingPage.FindViewById <ImageView>(Resource.Id.onboardingImage);
            var title   = onboardingPage.FindViewById <TextView>(Resource.Id.onboardingTitle);
            var content = onboardingPage.FindViewById <TextView>(Resource.Id.onboardingContent);

            var page = Pages[position];

            image.SetImageResource(page.Image);
            title.Text   = page.Title;
            content.Text = page.Content;

            container.JavaCast <ViewPager>().AddView(onboardingPage);
            return(onboardingPage);
        }
Exemplo n.º 5
0
        public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object view)
        {
            var viewPager = container.JavaCast <ViewPager>();

            viewPager.RemoveView(view as View);
        }
Exemplo n.º 6
0
 public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object @object)
 {
     container.JavaCast <ViewPager>().RemoveView(@object as View);
 }