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

Fix recyclerview fill all items #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LinZong
Copy link

@LinZong LinZong commented May 5, 2021

Pass MeasureSpec.UNSPECIFIED mode to child RecyclerView for providing a virtual 'infinite' vertical space will cause LinearLayoutManager try to 'fill' remaining space using ALL items in adapter, which may let main thread running measures for a long time. Just provide an 'infinite' horizontal space for long-line code is enough, then layout manager and touch event handle methods in RecyclerView can handle vertical scrolling perfectly. Can also fix missing velocity in code panel.

Flame chart showing such issue:
image

Screen records (Xiaomi MIX2S, Qualcomm 845, should not appear a loading holder for just a 370+ lines log file.):

out

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

Successfully merging this pull request may close these issues.

1 participant