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

ViewPager2 Sliding Lag #229

Open
PJYGit opened this issue Sep 7, 2021 · 1 comment
Open

ViewPager2 Sliding Lag #229

PJYGit opened this issue Sep 7, 2021 · 1 comment

Comments

@PJYGit
Copy link

PJYGit commented Sep 7, 2021

After migrating my ViewPager to ViewPager2 (so as the ViewHolder and Adapter), I'm facing some sliding lag problem.

I've found out that onCreateViewHolder() and onBindViewHolder() runs after the sliding motion when using ViewPager while it goes before when using ViewPager2. This may cause sliding lag problems since all these 2 functions run in the UI thread.

My ViewHolder is complex and it can't be simplified that well due to some business reason.Is it possible to delay these 2 functions in ViewPager2? Or is there any other way to solve my problem?

Appreciated!

@kriztho
Copy link

kriztho commented Mar 25, 2024

Has anyone from Google support looked at this? I'm still experiencing sliding lag even when I generate fragments that contain nothing but a simple background.

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

No branches or pull requests

2 participants