Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Incorrectly pinned section at the bottom of list view #68

Open
nonahex opened this issue Apr 22, 2015 · 0 comments
Open

Incorrectly pinned section at the bottom of list view #68

nonahex opened this issue Apr 22, 2015 · 0 comments

Comments

@nonahex
Copy link

nonahex commented Apr 22, 2015

Hello,
thanks for this library.
One small bug I discovered, there is an incorrect pinning a section, if list contains only Sections.

screenshot_2015-04-22-11-23-03
As you can see, Section 'O' is incorrectly pinned and not moved away. This happens only at the end of the list, with last shown item.

Correctly, it should be shown like this
screenshot_2015-04-22-11-25-37

I found out, issue is caused by wrong compare sign in method
int findFirstVisibleSectionPosition(int firstVisibleItem, int visibleItemCount)
at line 282, currently there is
if (firstVisibleItem + visibleItemCount >= adapter.getCount()) return -1; // dataset has changed, no candidate
and shoud be
if (firstVisibleItem + visibleItemCount > adapter.getCount()) return -1; // dataset has changed, no candidate

After shis adjustment, sections are shown correctly even in case shown above and there was no problem even in stadard use cases.

Hope, this will help someone.

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

No branches or pull requests

1 participant