Skip to content

Instantly share code, notes, and snippets.

@monotocho
Created July 23, 2012 15:45
Show Gist options
  • Save monotocho/3164319 to your computer and use it in GitHub Desktop.
Save monotocho/3164319 to your computer and use it in GitHub Desktop.
GetView - Gridview.
public override View GetView(int position, View convertView, ViewGroup parent)
{
View row;
AdapterArticuloConsultaItem item;
TextView lbTexto;
ProgressBar pbImagen;
ImageView ivImagen;
if (convertView == null)
{
row = new View(ctxt);
row = lif.Inflate(Resource.Layout.AArticuloConsultarItem, null);
}
else
{
row = (View)convertView;
}
item = (AdapterArticuloConsultaItem)items[position];
lbTexto = row.FindViewById<TextView>(Resource.AArticuloConsultarItem.textView1);
pbImagen = row.FindViewById<ProgressBar>(Resource.AArticuloConsultarItem.progressBar1);
ivImagen = row.FindViewById<ImageView>(Resource.AArticuloConsultarItem.imageView1);
lbTexto.Text = position.ToString();
ThreadPool.QueueUserWorkItem((object state) =>
{
System.Threading.Thread.Sleep(position + 1000);
//ImageView imageView = (ImageView)row.FindViewById(Resource.AArticuloConsultarItem.imageView1);
Bitmap bMap = BitmapFactory.DecodeFile(System.IO.Path.Combine(System.IO.Path.Combine(DDOL.MFile.SharedFolder(), "catalogo"), "000000.jpg"));
ivImagen.SetImageBitmap(bMap);
//Bitmap bMap = BitmapFactory.DecodeResource(null, Resource.Drawable.Icon);
//imageView.SetImageResource(Resource.Drawable.Icon);
pbImagen.Visibility = ViewStates.Gone;
NotifyDataSetChanged();
});
return row;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment