Пример #1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView;
            PhotosAdapterViewHolder holder = null;

            if (view != null)
            {
                holder = view.Tag as PhotosAdapterViewHolder;
            }

            if (holder == null)
            {
                holder = new PhotosAdapterViewHolder();
                var inflater = context.GetSystemService(Context.LayoutInflaterService).JavaCast <LayoutInflater> ();
                view         = inflater.Inflate(Resource.Layout.item_photo, parent, false);
                holder.Image = view.FindViewById <ImageView> (Resource.Id.item_image);
                view.Tag     = holder;
            }

            var image = photos [position];

            Koush.UrlImageViewHelper.SetUrlDrawable(holder.Image, image);

            return(view);
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView;
            PhotosAdapterViewHolder holder = null;

            if (view != null)
                holder = view.Tag as PhotosAdapterViewHolder;

            if (holder == null) {
                holder = new PhotosAdapterViewHolder ();
                var inflater = context.GetSystemService (Context.LayoutInflaterService).JavaCast<LayoutInflater> ();
                view = inflater.Inflate (Resource.Layout.item_photo, parent, false);
                holder.Image = view.FindViewById<ImageView> (Resource.Id.item_image);
                view.Tag = holder;
            }

            var image = photos [position];
            Koush.UrlImageViewHelper.SetUrlDrawable (holder.Image, image);

            return view;
        }