简体   繁体   中英

Multi-column image grid with dynamic loading in android

I want to load list of images from the server.

1) I prefer if I can use the screen space optimally by adjusting the image columns. 2) User should be able to click each image individually and navigate to the next screen. 3) Further, when the screen first loads, I would like to load few image slots with loading image and replace them when we get the data from the server. It will add additional image slots as well (ie after replacing first few) based on the data. so that user can see we are waiting for the data.

See below

在此处输入图片说明

What I already tried.

1) Using custom list view and adapter approach ( http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ ), I created a layout with two listviews, acting as two columns and loaded images each one separately. Issue is user will see two scrollbars when image list is long. Also cannot adjust the number of columns based on screen size.

2) Same custom list view with, row layout having two imageviews. Issue here is user cannot click individual imageview.

I was not able to replace images to implement the third requirement. How can I implement this. Are there any resources/controls I can use.

Thanks Pa

I would probably use a gridview and an adapter for the gridview items. Just load a local image for loading to the imageview of the griditems and replace them with the images from the server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM