Android Jetpack Compose Nested ViewPager Scrolling issues

173 Views Asked by At

We are writing an android application using compose where we have been dictated that the UX needs to have nested tab rows with a nested viewpager (not a great ux, but I'm just a lowly dev, what do i know?). The relationship is Category -> SubCategory -> Page.

The categories are in a parent tab row, with the sub-categories in a tab row beneath with the pages then displayed below that like so: ux screenshot

Our problem is that the expected behaviour is that when the user gets to the final sub-category, it should seemlessly switch the parent pager to the next parent category and start again. current behaviour

The behaviour of the viewpagers when you get the last item in the sub-category is very unpredictable as you can see.

A small sample app is here: https://github.com/timkemp22/horizontalScrollExample

we've tried disabling userScrollEnabled on the parent, but that just means when you get to the last subsection you can't scroll at all and have to tap the next category which is a big no-no from the ux point of view. We've tried a lot of other manual ideas in terms of finding if the page being displayed is the last page in the section and then bubbling up the scroll to next section manually, but it's not reliable.

0

There are 0 best solutions below