Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jaxim
Visitor

Lazy Loading of Rowlist items

Is there a way to lazy load thumbnail images when they get into view? Is there a way to unload these same images once they get out of view?

There is mention of lazy loading on the following page, but I am unsure what needs to be done in order to accomplish this feature. Is this just for GridView or can RowList use lazyLoading? 

https://sdkdocs.roku.com/display/sdkdoc ... s-GridView
3 REPLIES 3
jaxim
Visitor

Re: Lazy Loading of Rowlist items

UPDATE: I have not found a way to lazy load an item in a RowList yet. Has anyone figured out how to do this?

Also, let me define what I mean by lazy loading in case others define it differently.
Lazy Loading = loading a thumbnail image only when it is visible to the user. So as I scroll the rowlist to the right, each of the images of the thumbnails that were not visible should load once they become visible.
0 Kudos
BVatBBOD
Visitor

Re: Lazy Loading of Rowlist items

I do this in my app.

I simply start the grid with a ContentNode with a few (~30) sub ContentNode's.  On each item focus, I check to see how far they are down the list.  When they get (say 75%) down the list I trigger a task that then fetches the next 30 items.  As soon as the task returns them, I append those as ContentNode's to the grid's ContentNode.  I don't really worry about "unloading" the images as I believe Roku will handle unloading images as they go out of view (and in my experience it will).

Let me know if any of that is unclear. Also hit me up on Roku Dev Slack for more realtime discussion. (link in my sig)
Join the Roku Developers Slack Workspace for quicker help and great dev collaboration: http://tiny.cc/nrdf0y
0 Kudos
jaxim
Visitor

Re: Lazy Loading of Rowlist items

BVatBBOD, I will try that. I was hoping there would be an event to which the item could listen to know if it were visible, but I guess I will need to  do this outside of the RowList and hardcode that the fact that only 5 thumbnails (in my case) can be seen at any one time.

Thanks for the tip on the Slack channel, I'll be sure to subscribe! 
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.