Skip to content

Last item not visible - onLayoutChildren error#68

Description

@anthonyshim
  • Device:
  • OS Version:
  • Project Version:

馃悰 Describe

If the list is redrawn when the first item visible on the screen is out of the screen, the last item exposed on the screen is not drawn.

馃悓 Steps to reproduce

  1. Scroll the list so that the first item is off-screen
  2. In this case, the last item visible on the screen is not all exposed and a part must be outside the screen.
  3. When RecyclerView's notifyDataSetChanged() function is called

馃 Expected behavior

The last item is not drawn

馃 Other info

my fix suggestion

override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
...
            if (sizeFilled == 0) {
                sizeFilled = if (orientation == VERTICAL) {
                    layoutRect.top
                } else {
                    layoutRect.left
                }
            }
            sizeFilled += item.size

馃悵 Requested assignment

If possible, I would like to fix this.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions