When I put RecyclerView
inside NestedScrollView
then onBindViewHolder
is calling for all row like say I have list which has size of 30
But you set android:layout_height for NestedScrollView to wrap_content - here, it's zero by default (because there no content for him at the moment of the declaration). Next, for RecyclerView you set android:layout_height to match_parent - which is at the moment is 0. Thus, all your items have 0 height.
Thus, you have such situation. Solution: use solution above from @dkarmazi https://stackoverflow.com/a/37558761/3546306 or try to change parameter android:layout_height values.