Skip to content
New issue

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

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

Already on GitHub? # to your account

FlexibleAdapter#removeAllScrollableFooters() seems to notify incorrect item range #284

Closed
kvolkers opened this issue Feb 13, 2017 · 1 comment

Comments

@kvolkers
Copy link

kvolkers commented Feb 13, 2017

v5.0.0-rc1
https://github.com/davideas/FlexibleAdapter/blob/master/flexible-adapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java#L909

I think this line should be changed from:
notifyItemRangeRemoved(getItemCount() - 1 - mScrollableHeaders.size(), mScrollableFooters.size());
to:
notifyItemRangeRemoved(getItemCount() - mScrollableFooters.size(), mScrollableFooters.size());

Calling removeAllScrollableFooters() for these example items:
0 - Scrollable Header
1 - Scrollable Header
2 - Content Item
3 - Content Item
4 - Scrollable Footer

notifyItemRangeRemoved(2, 1) is called
getItemCount() => 5, minus 1 and minus 2 for mScrollableHeaders.size()

when I think it should be notifyItemRangeRemoved(4, 1)

@davideas davideas added the bug label Feb 13, 2017
@davideas davideas added this to the 5.0.0-rc2 milestone Feb 13, 2017
@davideas
Copy link
Owner

@kvolkers, yes, you're right, I'll fix it asap and initially publish as snapshot version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants