RecyclerView inside SwipeRefreshLayout inside NestedScrollViewLayout cannot scroll
You put RecyclerView
inside the NestedScrollView
.
I think better solution is to have NestedScrollView
or RecyclerView
but not both, because RecyclerView
is already implementing NestedScrollingChild
.
I have similar layout in my app. I did the same - put RecyclerView to FrameLayout and then inside the NestedScrollView. It's stop to work correctly. Without NestedScrollView everything works fine.
Two things:
First of all you don't have to embed your fragment container in NestedScrollView
if you want a scrolling behavior in your activity.
Put FrameLayout
directly into Coordinator layout with layout_behavior
attribute in it, then simply put any fragment with scrolling View (and it don't have to have layout_behavior attr).
So in your example you should have to fragments:
FragmentA
that has layout with CardView inside NestedScrollView
FragmentB
with RecyclerView inside SwipeRefreshLayout
Other problem is that you put more then one child in SwipeRefreshLayout
, and as stated in documentation it should have only one direct child. source