NestedScrollView inside ViewPager inside NestedScrollView: Innermost NestedScrollView not scrolling - android

So I have a Fragment which uses a CoordinatorLayout with a NestedScrollView inside. Inside that NestedScrollView is a ViewPager. Each item of that ViewPager is a CoordinatorLayout with a NestedScrollView inside.
The behavior I want is that when each item inside the ViewPager is scrolled up and down, my custom BottomBar will disappear and reappear.
When I scroll up and down, however, the BottomBar disappears and reappears, but the content in the innermost ScrollView does not move. This is the problem
Code posted below, any advice would be helpful.
Things I've tried:
Calling ViewCompat.setNestedScrollingEnabled() on nearly every view in the hierarchy that could scroll.
Calling requestDisallowInterceptTouchEvent(true) on the outermost NestedScrollView.
Main Activity:
Fragment w/ outer NestedScrollView:
Each item in ViewPager:

app:layout_behavior="#string/appbar_scrolling_view_behavior"
set this line in ViewPager it will help you

Related

NestedScrollView inside BottomSheet

I have a NestedScrollView inside a BottomSheet.
The problem is just sometimes NestedScrollView doesn't work and dragging on it detaches BottomSheet and starts dragging it.
Is there a bug in NesterScrollView?

NestedScrollView not scrolling

Ok so I have a global CoordinatorLayout with the following layout
content_main is a FrameLayout that fragments are transacted into. For this particular fragment I have a requirement of placing a TabLayout at a certain % of screenheight, so I went the route of using a ViewPager (with each fragment containing a NestedScrollView to coordinate with the CoordinatorLayout for proper scrolling behavior -- which all works as expected). However my transacted fragment layout (NestedScrollView) is not scrolling at all, however the layout_behavior is working as the AppBar/ToolBar are reacting to a scroll.
Any help on this would be greatly appreciated.
EDIT: I have created a sample project to show current broken behavior. https://github.com/bmc08gt/NestedScrollView-with-ViewPager The intended behavior is for the tablayout to collapse to the toolbar.

ViewPager swipe guesture not working when there's a NestedScrollView inside

I want to implement a viewpager with fragments inside, one of the fragments has the NestedScrollView inside, but when I put the NestedScrollView inside the layout of a fragment and run the project . The app shows as the picture below:
The scroll gesture of NestedScrollView working well with the AppBarLayout, but NestedScrollView prevents the swipe gesture of viewpager. When the NestedScrollView scrolls down a little,the AppBarLayout collapsed ,the swipe gesture cannot fired, so I cannot move to the next page of viewpager. This only happens with the NestedScrollView, the RecyclerView works well .
How can I make the NestedScrollView working well with the fragment?
This is the demo I told above: demo ,please change the layout of the fragment inside viewpager with the layout below:
lipsum is the very very long string

Scrolling issues of GridView inside Viewpager inside NestedScrollView

I am having a layout in which I am using CoordinatorLayout and NestedScrollView. I am using viewpager with 3 tabs in the nested scrollview. I am using fragments for the tabs and in one of the tab I am having Gridview.
So now, gridview scrolling is working inside that fragment only, I want the scrolling in the whole page.
Can you please help me here.
Thank you so much in advance.

ViewPager + PagerTabStrip inside ScrollView. It's possible?

That's the idea:
A ViewPager(Horizontal) insde ScrollView(Vertical). ViewPager will show diferents fragments depending on the tab, and has vertical scroll to show all fragment view on the screen.
But the thing is ViewPager isn't showing the fragment entirely, it doesn't expand the fragment's height or the ScrollView height.
There's a way to expand dinamically the ViewPager height or the ScrollView height to show completely the fragment using scroll?
<ScrollView>
<ImageView/>
<ViewPager>
<PagerTabStrip/>
</ViewPager>
<Button/> </ScrollView>
Rather than putting the ScrollView outside the ViewPager, instead you should make any views that populate the ViewPager (and need to scroll) ScrollViews.
This way each view (in the view pager) will have it's own vertical scroll offset that will be remembered as you page through the views.

Categories

Resources