Exemplo n.º 1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            LayoutInflater inflater = (LayoutInflater)profileActivity.BaseContext.GetSystemService(Context.LayoutInflaterService);
            View           view     = inflater.Inflate(Resource.Layout.Image_item, null);

            TwoImages slike = images[position];
            ImageView image1, image2;

            image1 = view.FindViewById <ImageView>(Resource.Id.slikaKorisnika1);
            image2 = view.FindViewById <ImageView>(Resource.Id.slikaKorisnika2);

            TextView kljucSlike1, kljucSlike2;

            kljucSlike1 = view.FindViewById <TextView>(Resource.Id.KljucSlike1);
            kljucSlike2 = view.FindViewById <TextView>(Resource.Id.KljucSlike2);

            kljucSlike1.Text = slike.Slika1.Kljuc;
            if (slike.Slika2 != null)
            {
                kljucSlike2.Text = slike.Slika2.Kljuc;
            }
            else
            {
                image2.Visibility = ViewStates.Invisible;
            }

            kljucSlike1.Visibility = ViewStates.Invisible;
            kljucSlike2.Visibility = ViewStates.Invisible;

            PostaviSlike(slike, image1, image2);

            return(view);
        }
Exemplo n.º 2
0
        private void PostaviSlike(TwoImages twoImages, ImageView image1, ImageView image2)
        {
            ViewGroup.LayoutParams param1 = (ViewGroup.LayoutParams)image1.LayoutParameters;
            param1.Height           = 360;
            image1.LayoutParameters = param1;

            ViewGroup.LayoutParams param2 = (ViewGroup.LayoutParams)image2.LayoutParameters;
            param2.Height           = 360;
            image2.LayoutParameters = param2;

            image1.Click += Image1_Click;
            image2.Click += Image2_Click;
            image1.SetImageBitmap(BitmapConverter.ConvertStringToBitmap(twoImages.Slika1.Sadrzaj));
            image2.SetImageBitmap(BitmapConverter.ConvertStringToBitmap(twoImages.Slika2.Sadrzaj));
        }
Exemplo n.º 3
0
        public void OsposobiAdapter(List <TLSlika> slike)
        {
            List <TwoImages> _listOfTwoImages = new List <TwoImages>();

            for (int i = 0; i < slike.Count / 2; i++)
            {
                TwoImages images = new TwoImages();
                images.Slika1 = slike[i * 2];
                images.Slika2 = slike[i * 2 + 1];
                _listOfTwoImages.Add(images);
            }
            if (slike.Count % 2 != 0)
            {
                TwoImages images = new TwoImages();
                images.Slika1 = slike[slike.Count - 1];
                _listOfTwoImages.Add(images);
            }

            _listaSlika.Adapter = new UserImagesAdapter(this, _listOfTwoImages);
        }