ViewPager offscreen page limit

Is it possible to disable the offscreen page limit?

No. It is already set to the minimum possible value: one page to each side of the viewed page. This is necessary to have the animation effects work — you see parts of two fragments (original and new) at the same time.

My goal is to only download images when a fragment is selected, or only when the user is hovering the image.

Then load your grid with placeholder images, and do not load the real images until the page is changed.

Also, note that “hover” implies some sort of mouse or similar sort of pointer, which is not used on most Android devices.

Leave a Comment