Search code examples
androidandroid-viewpagerviewdraghelper

Using ViewDragHelper to vertical dragging and ViewPager


i'm trying to achive this on my application: youtube link

The goal is to have a ViewPager that can be dragged vertically but at the same time you can swipe the views inside of ViewPager, the problem is when i swipe inside of viewPagger horizantally the dragg resets to the inicial position

to achive what is in the video, i follow this blog post

So i implemented a DraggerViewHolder that extends to a FrameLayout and then ViewDragHelper inside of it! all the code is at github

So, how can i make it stay on the same drag state?


Solution

  • So finally i have manage to fix the problem(sort of because sometimes i still get the "bug").

    You can see in the github repo(in the question) the commit with the fix, for more information about the solution see this question