Closed mrtristan closed 11 years ago
I'm using 2 lazy loaded images in my listview rows so i can confirm this is possible. I don't have access to my code right now but i's not complicated.
Not to hijack you question but i've got a related question:
Imaging you have multiple items in my listview rows that are expensive to load. for instance 2 are web images and 1 is something local but which is just expensive to load. I'm wondering if the following is possible to achieve:
At the moment, when 1 of the resources cannot load, none of the 3 items load in the listview. I would like to see that, let's say, when i have no internet connection, the 2 images don't load but my third local resource does continue to load. Or when 1 of the images cannot be downloaded but the second can, only show the second.
Is it possible to implement such logic?
interesting limitation.... i said two as a proof of concept but i would have multiple points of implementation for this library... at one of the more complicated points in my app, i have a listview that involves 4 web images and a number of locally loaded assets per row.
if you don't mind, i'd be interested in seeing how you altered things to make this work for you.
@mrtristan Yes, it should be possible to load multiple images by simply making your ItemLoader's Result type an object that holds all bitmaps/drawables that have to be loaded asynchronously. The displayItem() method would then just use this object to display them.
The problem with the current API is that it requires you to load the whole content of each item at once, even if the content comprises multiple parts (like your example with multiple images per item). This means that there's no way to apply priorities to each part of the item. For example, if you have a main image and an avatar image per item, you probably want to prioritize the loading of the main image for each item over their avatar images. This is an API change that I haven't finalized yet to land in the repo. But stay tuned.
@murimons If you make your ItemLoader's Result type something that can hold the multiple parts of the item, then you can probably load parts of each item separately instead of failing the whole item loading when one of the parts fail.
I'm closing this issue as it doesn't seem to have anything actionable for now. Feel free to re-open if you still think something can be done about it.
sorry if this comment reopens this. i'm not terribly familiar with github issues. i'm curious to see how this will work, do you have any timetable for what you're working on?
@mrtristan No timetable, sorry. I'm far from done though. So feel free to submit API proposals to cover your use case in the mean time :-)
sounds good. great work so far. if i get some free time to attempt shoehorning this in to my project i'll bounce some things off you as i work through it..
thanks again! :-)
any thoughts as to how to go about loading multiple images in a single row? looking through the code, i can't tell if it would be a rather complicated mess to handle or if it is pretty much baked in. sorry if this is an inappropriate forum for this question, but i figured it would be a good publicly answered question for others who are curious.