Android imitation Sina Weibo custom listview drop-down refresh (4)

Custom pulltorrefreshlistview inherits from listview and adds a drop-down header layout in the header of listview. The usage is exactly the same as listview.

For details of the custom listview code, please refer to: https://www.oudahe.com/p/23152/

The detailed code of the adapter is described in detail here.

1. First bind the listview layout to the adapter. 2. Secondly, create a class corresponding to components in the hierarchy to associate the corresponding components with objects to improve efficiency. 3. Then download the pictures asynchronously with the picture path obtained by Lu. Because the number of microblog pictures is unknown, add a girlview control or girllayout layout in listview, and then add the obtained pictures to it and arrange them according to the specified attribute values.

Method of asynchronously downloading pictures. Softreference is a soft reference, which is used to recover variables better; After getting the picture path from the cache, create a new thread to download the picture.

design sketch:

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>