How to implement interactive vertical Fragment transitions that follow swipe/touch?

50 Views Asked by At

I'm trying to do a sort of infinite scroll. Each Fragment contains a scrolling WebView (or ScrollView), and when the user hits the bottom, I'd like to test for continued swiping to reveal the next Fragment below.

The user should not be able to go back, and I'm not interested in caching, so that rules out RecyclerView or ViewPager (modified to scroll vertically). I'm only concerned about managing the current Fragment, loading the next, and removing the last one once it's offscreen.

I want the next Fragment to follow the users touch, and I want the transition to abort if the user lets go below a certain threshold.

FragmentManager allows custom animations but they are non-interactive. I could perhaps write my own ViewGroup where I can manually animate a Fragment into position, and remove the previous Fragment manually, but I'm not sure if this is the best path forward.

Anyone have thoughts/tips on a good approach here?

0

There are 0 best solutions below