sayyam / carouselview

A simple library to add carousel view in android app.
Apache License 2.0
1.15k stars 261 forks source link

Set off screen page limit #72

Open dsuresh-ap opened 7 years ago

dsuresh-ap commented 7 years ago

Is there a way to set the off screen page limit? It seems like access to it is private. setData() uses the page count to set the off screen page limit. This is a problem when loading a lot of high res images.

containerViewPager.setOffscreenPageLimit(getPageCount());

sqljim commented 3 years ago

Do you find that this is really slow? I'm having an issue at the moment where the more images I have the longer this function takes to return. At the moment it's blocking my UI thread as well and causing a 10-15 second delay for loading 12 images.

dsuresh-ap commented 3 years ago

@sqljim I haven't used this library in sometime but if the logic is still using setOffscreenPageLimit(getPageCount()); I would imagine it to be slow. Looks like this library hasn't been updated in 2 years so would recommend finding another library.

saryevnm commented 1 year ago

carousel_view.containerViewPager.offscreenPageLimit = 0, you can set it like this, right after setting page count