[SOLVED] Concatenating lists
#1
Hi all.
I'm currently working on a skin and would like to concatenate 2 (or more) vertical lists. So far I've been able to work it out almost correctly, but I have one last problem: when I move from the list above to the one below using the "down" key the highlighted item is not the first of the list below, but the first of the currently selected page of the list below (so, if I'm seeing items from 11 to 20, it will go to position 11 instead of 0). Strange enough, the other way around (thus going "up" from the list above to highlight the last item of the list below) works like a charm.
In order to implement this behavior I'm using the built-in function SetFocus() that I have seen in other topics being described as setting the focus of the item indicated in the currently visible page of the list. Now, this is coherent with the "wrong" behavior I'm getting, but not with the "right" one. Furthermore, using the trick of inserting a second invisible list with the same id in order to screw up xbmc internals about remembering the last position seems not to work in my case.

Any ideas on how I could solve this problem? I even tried with Control.Move() and Control.Message(), but I can't seem to find a solution with those either.

Thank you! =)
Reply
#2
Try with a wrap or fixedlist and define the focusposition.
Reply
#3
With fixedlist it works slightly better but, of course, it suffers the problem that the highlighted element is fixed and the list scrolls... With wrap it's not possible, because once you reach the end it starts again from the beginning and you never come out with up or down even if you specify a different control for those actions.
Nevertheless, I was able to find a viable way both with list and fixedlist. The trick is to use Control.Message(id, movedown) or Control.Message(id, moveup) plus telling xbmc which control to focus. So, for example, in order to switch over to list with id="50" the proper xml seems to be:

PHP Code:
<onup>Control.Message(50,movedown)</onup>
<
onup>Control.SetFocus(50,90000)</onup>
<
ondown>Control.Message(50,moveup)</ondown>
<
ondown>Control.SetFocus(50,0)</ondown

Edit: I edited the above code because SetFocus() is still required for proper behavior in case the landing list is short and doesn't require scrolling. 90000 is used as a rather big number just to tell xbmc to go to the end; it seems to do the trick if using a simple list.
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] Concatenating lists0