Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First and last Views getting destroyed even after using DEFAULT_BOUNDARY_CASHING true #31

Open
summers314 opened this issue Feb 10, 2016 · 3 comments

Comments

@summers314
Copy link

No description provided.

@kyze8439690
Copy link

Just call setOffscreenPageLimit() with you pager size.

@galihuotui
Copy link

setOffscreenPageLimit() should set adapter wrapper's count or real adapter's count ?

@Ninjars
Copy link

Ninjars commented Jul 24, 2018

LoopPagerAdapterWrapper.destroyItem() has a bug: realPosition can be less than realFirst, which appears to be an unexpected situation. Changing if (mBoundaryCaching && (position == realFirst || position == realLast)) to if (mBoundaryCaching && (position <= realFirst || position >= realLast)) significantly improves the behaviour around destroying views.

A bug remains: when swiping backwards from the start, the last item is still recreated. This only happens the first time, however.

I was considering making a PR for the change, but given it's still buggy I thought I'd just contribute a suggestion, as I don't have the time to delve deeper now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants