I want to create a pane in which there are two RecyclerViews (let's say 'MyItems', 'AllItems'). I have created vertical LinearLayout, in which there are TextView as title and RecyclerView. Something like this:
<LinearLayout ... >
<TextView
android:text="My Items"
... />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_items"
... />
<TextView
android:text="All Items"
... />
<android.support.v7.widget.RecyclerView
android:id="@+id/all_items"
... />
</LinearLayout>
However with this approach, only recyclerViews are scrollable independently, but I need the whole layout to be scrollable only (so firstly it scrolls through first section, then second). I tried to wrap it up in ScrollView and NestedScrollView, but the closest I got was scrolling without smooth animation.
My question is, is this approach valid, and if so, is there a way to add smooth scrolling in NestedScrollView? Or should I implement this using another approach, e.g. create ListView that contains two items with layout containing TextView and RecyclerView?
ListView
List item 1
- Title 1
- RecyclerView 1
List item 2
- Title 2
- RecyclerView2
I believe this approach is not good from performance side of view. Am I right? I just need to find the best practice for this. Thank you.

Please don't use nested scrolling. It will defeat the purpose of recycler view and will keep everything inside the memory as the height will be set to maximum for both the recyclers. Instead proceed with the following two choices:
1.If you don't have a specific background, create a single RecyclerView with adapter similar to the following:
Then set your adapter like following:
This way, you can use the RecyclerView to contain your textview too. This method will give you the best optimization. Make sure that you return the appropriate VIEW_TYPE in getItemViewType() for your upper recyclerView, lower RecyclerView and the TextViews.
The second method is to have one RecyclerView containing 4 items:
Then populate these LinearLayouts with items dynamically. This will ensure that at least one of the Linearlayout is recycled when out of view. Even then, the first approach will be a far better approach than this.