Skip to content

Replace ViewPager with ViewPager2 to achieve better performance. - #880

Open
kn0w-n0thing wants to merge 1 commit into
zhihu:masterfrom
kn0w-n0thing:master
Open

Replace ViewPager with ViewPager2 to achieve better performance.#880
kn0w-n0thing wants to merge 1 commit into
zhihu:masterfrom
kn0w-n0thing:master

Conversation

@kn0w-n0thing

Copy link
Copy Markdown

Above of all, please let me show the appreciation of this project.
But a little problem came to me when I migrated the codes to my own project. That is, ViewPager's performance is not good enough. Whenever a preview page is slided in, a new PreviewItemFragment is crated.
So I replace ViewPager with ViewPager2, which automatically caches one page on each side of the current preview page.
I hope it will be helpful to the project :)

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