Finding a replacement for FragmentStatePagerAdapter

∥☆過路亽.° 提交于 2019-12-02 10:23:59

问题


I want to find a replacement to the FragmentStatePagerAdapter + PagerFragment as we all know the FragmentStatePagerAdapter is still broken up to this day. There have been a bunch of attempts on github and by myself to make something that mimics the functionality of the FragmentStatePagerAdapter, except all of them seem to have extremely complicated logic with bugs that seem impossible to debug, e.g. https://gist.github.com/ypresto/8c13cb88a0973d071a64.

The core functionality of my application needs to be able to display fragments/views dynamically, e.g. a photo carousel with interleaving ads as the user swipes from left to right and vice versa. And we can dynamically remove or add or manage stuff from/to the adapter.

I've been thinking of potentially making a horizontal recycler view with the view taking up the full screen, and having a bunch of listeners that make the view "center" as the user swipes so that it has a view pager feel to it. But I'm not 100% convinced that this is the best solution to solving this issue. I was wondering if anyone has ever come across issues with FragmentStatePagerAdapter, and has found a good solution to workaround.

Thanks for the help!

来源:https://stackoverflow.com/questions/42150435/finding-a-replacement-for-fragmentstatepageradapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!