Gridview shows the progress of loading androidprogressbar when loading images asynchronously <br>

DC

GridView loads images asynchronously, each view shows the progress bar progress... The gallery is still using this method to avoid the picture without load – when it cannot slide.




Cima Motor

Gridview layout file:









High voltage motor

Item gridview_item layout file. XML:





When the image shows progress:

Public view getview (int position, view convertviewviewgroup parent) {if (convertview==null) {layoutinflaterlayoutinflater=layoutinflater. From (mmainactivity); Convertview=layoutinflater. Inflatable (r.layout.Gridview_item,null);gridview. Layoutparamsparams=New display data table. Layoutparams(mmainactivityalbumwidthmmainactivity.Albumheight);Convertview. Setlayoutparams(params);}convertview. Settag (position) ;/ / progress bar shows the first progressbarpb = (progressbar) convertview. Findviewbyid(r.i.d.grid_progressbar);lead. Setvisibility (visible); ImageviewImageview=(Imageviewconvertview). Findviewbyid(r.i.d.grid_imageview);Imageview. Setscaletype(imageview.Scaletype.Center_inside);Imageview. Setadjustviewbounds(true); Syntask. Loadimage(position, imageurls.Get(position), imageloadlistener); returned image //async convertview;}


Hide the progress bar after loading the picture:
The view of the view = mgridview (view). Findviewwithtag(t); if (view!=null) {// hide progress bar progressbarpb=(progressbar) view. Findviewbyid(r.i.d.grid_progressbar);lead. Setvisibility (reason);//The displayed image is loaded into the imageviewimageview=(imageview) view. Findviewbyid(r.i.d.grid_imageview);Imageview. Setbackgrounddrawable(movable);}














Copyright Statement: The original blog post in this article cannot be reproduced without the consent of the blogger.

Android asynchronous messaging framework

We are specialized manufacturer of Button Attaching Sewing Machine in China. Features for Button Attaching Machine: Beautiful Sewing and Easy to Adjust Sewing Functions; Extremely Low Noise and Vibration for Operator -Friendly Sewing; Overwhelmingly Superior Productivity with the World's Fastest Cycle Time; High Energy Saving; Easy Maintenance; Clean Sewing with Semi-dry Type; User-friendly Operation Panel and Environment-conscious.

Button Attaching sewing machine

Pattern Sewing Machine,Wholesale Pattern Sewing Machine,Pattern Sewing Button Machine,Household Pattern Sewing Machine

DONGGUAN CHUANGHUI SEWING MACHINE CO.,LTD , http://www.ch-sewing.com

This entry was posted in on