preloaditems condition?
#1
Hi

I'm using a movie list view that looks like the following (see below) showing 3 movie cases at a time.

I use preloaditems set to 2 to speed up the scrolling. This works fine until i enter a movieset that contains 5 movies, then the scrolling has a huge gap.

Setting preloaditems to 0 solves this.

My question is can i set up a condition to allow preloaditems set to 2 and only disable it when list has 5 items.

I tried the following but no luck
Code:
<preloaditems condition="!Container().NumItems = 5">2</preloaditems>

Thanks for any info

Reply
#2
nope, you can't use a condition there.

what type of container are you using? does it make a difference if you switch from, for example, list to wraplist or panel?
does the issue only occur when container content is sets? or does it also happen for movies as well?
i assume you're using background="true" in your image controls...
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2017-12-13, 00:34)ronie Wrote: nope, you can't use a condition there.

what type of container are you using? does it make a difference if you switch from, for example, list to wraplist or panel?
does the issue only occur when container content is sets? or does it also happen for movies as well?
i assume you're using background="true" in your image controls...
 Hi Ronie

Thanks for the reply

Im using the wraplist as it suits the viewtype the best as the bottom case needs to be focused always, and when there is a short list the cases wrap around during scroll. Using panel doesnt have the issue but the scrolling is not fixed. Fixedlist works fine is large list but leaves gaps as the cases dont wrap around when there is a small list.

Yes im using background="true" on image textures.

If i set preloaditems to one then the gap occurs when there is 4 items. When set to 2 it occurs with 5 items.

The issue happens anywhere there is 5 items with preload set to 2 or 4 items preload set to 1.  I think its an issue with how the view is needing 3 cases displayed while the preloaded only has 2 causing a gap.

Whats the difference between background loader and preloaditems? Do you need to have preloaditems while background true is set?

Thanks for any info.
Reply
#4
odd that it only affects wraplists... might be a bug in kodi somewhere.

there's not much documentation about pre-/background loading, but you'll want to use both
http://kodi.wiki/view/Background_Image_Loader
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
(2017-12-12, 23:18)the_bo Wrote: I use preloaditems set to 2 to speed up the scrolling.

Preloaditems doesn't do what you think it does - it wont make scrolling faster or smoother. Instead it loads images for items that are offscreen (well outside the dimensions of the list container).

e.g. you might have a list like this, where the 5th item is on the edge of the list.
|--1----2----3----4---|

Because the 5th item is past the edge of the list, if preloaditems=0 is set, then when you scroll the images for the offscreen item wont load until it's on screen. With preloaditems=2, the next 2 items past the edge of the list are loaded into memory whilst still offscreen, so that you see the image as it scrolls onto the screen. Does that make sense? It's a bit difficult to explain.

The background loader is entirely different. Basically it does what it says - it loads images in the background. If background=false then the image must load into memory *before* the list responds to user input. Whereas with background=true, the list wont wait for the image to load before reacting - the image moves into memory in a separate background thread. Background=true for big images makes lists move smoother, but at the trade off of some images not being loaded quick enough to display in time.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#6
(2017-12-14, 10:47)jurialmunkey Wrote:
(2017-12-12, 23:18)the_bo Wrote: I use preloaditems set to 2 to speed up the scrolling.

Preloaditems doesn't do what you think it does - it wont make scrolling faster or smoother. Instead it loads images for items that are offscreen (well outside the dimensions of the list container).

e.g. you might have a list like this, where the 5th item is on the edge of the list.
|--1----2----3----4---|

Because the 5th item is past the edge of the list, if preloaditems=0 is set, then when you scroll the images for the offscreen item wont load until it's on screen. With preloaditems=2, the next 2 items past the edge of the list are loaded into memory whilst still offscreen, so that you see the image as it scrolls onto the screen. Does that make sense? It's a bit difficult to explain.

The background loader is entirely different. Basically it does what it says - it loads images in the background. If background=false then the image must load into memory *before* the list responds to user input. Whereas with background=true, the list wont wait for the image to load before reacting - the image moves into memory in a separate background thread. Background=true for big images makes lists move smoother, but at the trade off of some images not being loaded quick enough to display in time.      
Thanks Jurialmunkey for the detailed info.

Yeah the preloader makes sense now cheers. A workaround for now i may create 2 wraplists, with preloader set to 2 for movie list and have another wraplist preloader set to 0 when inside moviesets. May be a little overhead on the skin but could do for now.

Is it for performance reasons that preloader is maxed at 2?

To show you the issue here is a video showing the gap when list has 5 items and preloader set to 2.



Here is video showing how list scrolls normally when list is less than or greater than 5 with preloader set to 2.

Reply
#7
Not really sure what the solution is. Definitely seems like a bug.

In regards to why preloaditems is limited to 2, I guess it is because bigger values don't really make sense - you only really need to have the next item offscreen to be preloaded. Having a value of 2 adds a bit of a buffer. If you were doing a fast scroll (long press direction), I don't think a value of 3 or 4 would make a whole lot of difference (and it has to be capped somewhere for performance concerns).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
preloaditems condition?0