public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var        view = convertView;
            ViewHolder holder;

            //  var local = new LocalOnClickListener();

            LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);

            if (view == null)
            {
                holder = new ViewHolder();

                view = inflater.Inflate(Resource.Layout.gridviewaboutexam_layout, null);


                holder.txtview = (TextView)view.FindViewById(Resource.Id.textViewGrid);

                ImageView imgview = view.FindViewById <ImageView>(Resource.Id.imageViewGrid);



                holder.txtview.Text = aboutexam[position].name;
                // imgview.SetImageResource(gridViewImage[position]);
                //  imgview.SetImageResource(thumbIds[position]);
                imgview.SetImageResource(Resource.Drawable.aboutexam);
                view.Tag = holder;
            }
            else
            {
                holder = (ViewHolder)view.Tag;
            }
            return(view);
        }
Esempio n. 2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var        view = convertView;
            ViewHolder holder;

            var local = new LocalOnClickListener();

            LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);

            if (view == null)
            {
                holder = new ViewHolder();

                view = inflater.Inflate(Resource.Layout.StudyMaterial_ListView_Adapter_Layout, null);


                holder.txtview = (TextView)view.FindViewById(Resource.Id.text_SM);

                TextView txtviewurl = (TextView)view.FindViewById(Resource.Id.text_SM_url);

                ImageView imgview = view.FindViewById <ImageView>(Resource.Id.image_SM);

                ImageView imgviewTitle = view.FindViewById <ImageView>(Resource.Id.image_SMTitle);



                holder.txtview.Text = study_data[position].content_id;

                txtviewurl.Text = study_data[position].click_url;

                // imgview.SetImageResource(gridViewImage[position]);
                //  imgview.SetImageResource(thumbIds[position]);
                imgview.SetImageResource(Resource.Drawable.aboutexam);

                var imageBitmap = GetImageBitmapFromUrl(study_data[position].content_title);
                imgviewTitle.SetImageBitmap(imageBitmap);


                view.Click += (sender, e) => OnClick(position);

                view.Tag = holder;
            }
            else
            {
                holder = (ViewHolder)view.Tag;
            }
            return(view);
        }