Should preloaded images load in ListView?

I populate a list of relatively complex list items, including multiple text views, a button, and ImageView. The images associated with each element are unique, but have been pre-downloaded from the Internet, so I do not need to wait for an HTTP request to download the image.

However, I wonder if it would be wise to lazily load images from memory so that the list can be displayed as quickly as possible. Android has this behavior in the list of control applications. It fills the list with general data and adjusts each item as the data becomes more accessible.

How big is the performance issue, loading multiple images from memory into a list (especially considering the fast scrolling of large lists (over 300 items))? What are the tradeoffs I need to consider?

+3
source share
1 answer

No need to do any lazy loading. A ListViewhas a lazy load. It only loads the list items that are currently visible on the page. It loads the later items in the list as you scroll.

In general, I would try to optimize this if you really have performance problems. As stated in Design for Performance ,

There are two basic rules for writing efficient code:

  • , . .
  • , .

- , , , .

0

Source: https://habr.com/ru/post/1788253/


All Articles