Posts: 26,215
Joined: Oct 2003
Reputation:
187
I know what the problem is:
1. Container.OnNext triggers for a single frame.
2. Container.Position gives you the current focus.
3. When scrolling, Container.Position is updated _after_ the scroll has been completed (or at least a frame after the scrolling starts)
4. When not scrolling, Container.Position is updated immediately.
Thus, when not scrolling, the position increases by 1, thus if you're in position 4 and press right, container.position will read 5 immediately. When scrolling, if you're in position 5 and press right, container.position will read 5 until the scrolling actually gets under way. Hence, you're described problem.
The only way to fix this without breaking other stuff is to have two new events Container.OnScrollNext and Container.OnScrollPrev.
Cheers,
Jonathan
Posts: 26,215
Joined: Oct 2003
Reputation:
187
As of r26519 we now have Container.OnScrollNext/OnScrollPrevious that *should* do the trick. Untested though.
Note that this is in addition to Container.OnScrolling which triggers only after the user has been scrolling through more than one item.
Cheers,
Jonathan
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Confirm it by putting an image that pops up if OnScrollNext is set (obviously with a hidden anim on it otherwise it'll flash up for just 1 frame).
Posts: 17,390
Joined: Aug 2007
Reputation:
583
Hitcher
Team-Kodi Member
Posts: 17,390
2010-01-10, 22:29
(This post was last modified: 2010-01-10, 22:56 by Hitcher.)
I'm having similar problems trying to fade a label using Container(id).OnScrollNext/OnScrollPrevious or Container(id).OnNext/OnPrevious when selecting the next/previous item in a wrap or fixedlist.
I can get it to fade if I use Container(id).Scolling so I know the fade control is working but it does nothing if I use Next/Prev or ScrollNext/ScrollPrev.
EDIT: Ignore me, I had the fade start and end values the wrong way around. Works using Container(id).OnNext/OnPrevious.
Posts: 17,390
Joined: Aug 2007
Reputation:
583
Hitcher
Team-Kodi Member
Posts: 17,390
What platform are you using Jonathan?
I just tried this on Windows build SVN:26459 and it didn't work.
Posts: 302
Joined: Jun 2009
Reputation:
3
2010-01-11, 10:20
(This post was last modified: 2010-01-11, 10:29 by eumel.)
The only difference that i can see between OnNext and OnScrollNext is, that OnNext is not true if i jump in the fixedlist from the last to the first item.
I think there is a bit mixed up, I need a condition that allow me to know when a Panel shows the next line/item.
On the other side, we need a condition for Fixedlist/Wraplist, if they use <movement> that allow us to know when we change the focusposition in the list. (OnNext/OnPrevious work only on the set <focusedposition> not above or below).
ps.: sorry if i'm not understandable, but my english is not the best