Created
July 23, 2012 15:45
-
-
Save monotocho/3164319 to your computer and use it in GitHub Desktop.
GetView - Gridview.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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