You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you add empty NestedGroups to a GroupAdapter, they aren't accounted for when you call GroupAdapter.getItemCount() and therefore the item count that you see from your adapter will technically be off by how many empty groups exist in your adapter at the time.
I tracked this bug down while trying to do some automated scrolling to bottom of the GroupAdapter's RecyclerView on certain events, and noticed that my scrolls were off by a certain amount every time. After debugging through GroupUtils.getItemCount -> NestedGroup.getItemCount, I noticed that I had 2 empty Groups in my adapter that weren't being counted. I confirmed by adding 2 to the item count when scrolling, and it was scrolling to the expected position each time afterward.
To Reproduce
Steps to reproduce the behavior:
Add an arbitrary number of NestedGroups to a GroupAdapter, attached to a RecyclerView.
Attempt to scroll to a certain position (RecyclerView.smoothScrollToPosition). My test case was for the bottom (itemCount - 1)
RecyclerView scrolls to two Groups before your specified position (e.g. if you try and scroll to bottom, it will instead scroll to the second Group above the bottom).
Expected behavior
Expected behavior would be to include empty NestedGroups in the GroupAdapter's item count, so that we have the "correct" number of items in the adapter for situations like this.
Library version
2.10.1
Additional context
It probably makes more sense to not add empty Groups, though there might be (semi-valid) reasons to do so.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you add empty
NestedGroup
s to aGroupAdapter
, they aren't accounted for when you callGroupAdapter.getItemCount()
and therefore the item count that you see from your adapter will technically be off by how many empty groups exist in your adapter at the time.I tracked this bug down while trying to do some automated scrolling to bottom of the
GroupAdapter
'sRecyclerView
on certain events, and noticed that my scrolls were off by a certain amount every time. After debugging throughGroupUtils.getItemCount
->NestedGroup.getItemCount
, I noticed that I had 2 empty Groups in my adapter that weren't being counted. I confirmed by adding 2 to the item count when scrolling, and it was scrolling to the expected position each time afterward.To Reproduce
Steps to reproduce the behavior:
GroupAdapter
, attached to aRecyclerView
.RecyclerView.smoothScrollToPosition
). My test case was for the bottom (itemCount - 1
)RecyclerView
scrolls to two Groups before your specified position (e.g. if you try and scroll to bottom, it will instead scroll to the second Group above the bottom).Expected behavior
Expected behavior would be to include empty
NestedGroup
s in theGroupAdapter
's item count, so that we have the "correct" number of items in the adapter for situations like this.Library version
2.10.1
Additional context
It probably makes more sense to not add empty Groups, though there might be (semi-valid) reasons to do so.
The text was updated successfully, but these errors were encountered: