Need some oop tips for a preloading image gallery

hi all,

There is my image database. Dynamic count, each element with different grid size (1x1 to 1x2).
Representation of preloaded items in grid 3x10. Smooth scrolling, no jumping per row.

I tried several approaches, now I would appreciate some oop advice on how to set this thing up. My current approach would look like this:

A “Y” spread with the count of my visible rows, that wraps around my gallery min max coordinates, controlled by mouse or touch. This way I have always accurate positions.

Each Y coordinate carries a “row” object. On wrapping the row loads new pictures from above/below the currently shown pictures within the collection. it also contains the logic to skip over pictures that are too large for the grid spaces left in the current row.

I am also not clear on which collection is best for this use case. I tried it with an ordered dictionary, but I found no smart way to identify all pictures above and below the ones currently displayed. I mean smarter than checking the keys of the whole collection if they are smaller than… and keeping the spread.

MS uses IncrementalLoadingCollection for that, the idea is that there is method “GetMoreItems” and you call that to add more items to collection when you reach the end of page, but the problem is that they use lazy loading and image loader it self manages loading and unloading images… Not sure how to do that in gamma…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.