I have collection list and shelf. I can download only 10 items. When user scrolled to end, I should make new request. But i dont how detect end of scroll in xml or in js
TVML / tvOS Detect end of scroll
333 Views Asked by kylesp1995 At
2
There are 2 best solutions below
0

Same requirement i had but i couldn't find any direct way to achieve this so what i did for my app, can tell you.
Step-1 : while rendering your 10 items on UI using xml, you can add one attribute to the ui element (for me it was lockup) in xml file.
ex : < lockup index="{{index}}">
Step-2 : Add the doc for event listing
doc.addEventListener("highlight",_handleHighlight)
Step-3 : Each time the lockup get focus, control will come to _handleHighlight function. there you can find the index , based on that perform the pagination.
_handleHighlight(event) {
var self = this;
var ele = event.target;
var index = ele.getAttribute("index")
// if idndex > (item.count - 3) perform pagination
}
I have discovered sample codes from Apple and found one intersting event. It calls "needsmore".