With the creation of NestedScrollView, you can put the scroll in another scrollable view if they implement NestedScrollingChild and NestedScrollingParent correctly.
(This is a good Yan Lake design template (from Google), actually recommends putting RecyclerView inside the subview: plus.google.com/u/0/+AndroidDevelopers/posts/9kZ3SsXdT2T ")
I want to put a RecyclerView inside a NestedScrollView and, fortunately, RecyclerView implements a NestedScrollingChild , so you can put it inside a NestedScrollView .
public class RecyclerView extends ViewGroup implements ScrollingView, NestedScrollingChild
I read these posts:
How to use RecyclerView inside NestedScrollView?
NestedScrolling with NestedScrollView, RecyclerView (horizontal) inside the coordinator Layout
But the problem with most of the voted solutions is that it calls all RecyclerView elements, for example, if it is an infinite RecyclerView, and when the user reaches the end of the list that you want to make network, then with this solution RecyclerView calls the server again, because it automatically reaches the last element of the RecyclerView .
Anyway, how to set the parameter so that I can put the RecyclerView inside the NestedScrollView . (actually I want to set the view group as framelayout or relativelayout as one child of the nestedscrollview, and then I want to put the recyclerview inside the framelayout or relativelayout)
When I put the RecyclerView inside the NestedScrollView , nothing is visible.
To create a sample project, you can use cheesesquare and change the CheeseDetailActivity to have a RecyclerView.
Although BNK's answer is incorrect, BNK has tried a lot. Therefore, I reward him with generosity. Still looking for a good solution ....
android android-recyclerview
mmlooloo 25 Oct '15 at 13:46 2015-10-25 13:46
source share