title: RecyclerView inside a ViewPager inside another RecyclerView not scrolling
body: <p>I'm trying to make a user profile like Vine/Instagram. I have profile fragment and inside that I have a RecyclerView containing two different ViewHolders. One of them is the header (user's profile picture, username, etc.) and the other one is a TabLayout and ViewPager.</p>
  
  <p><strong>ProfileAdapter.java</strong></p>
  
  <pre><code>private static final int TYPE_HEADER = 1;
  private static final int TYPE_PAGER = 2;
  
  private Context mContext;
  private FragmentManager mFragmentManager;
  
  public ProfileAdapter(Context context, FragmentManager fragmentManager) {
      this.mContext = context;
      this.mFragmentManager = fragmentManager;
  }
  
  @Override
  public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      RecyclerView.ViewHolder viewHolder;
      LayoutInflater inflater = LayoutInflater.from(mContext);
  
      if (viewType == TYPE_HEADER) {
          View view = inflater.inflate(R.layout.layout_profile_header, parent, false);
          viewHolder = new ProfileHeaderViewHolder(view);
      } else {
          View view = inflater.inflate(R.layout.layout_profile_view_pager, parent, false);
          viewHolder = new ProfileViewPagerViewHolder(view);
      }
  
      return viewHolder;
  }
  
  @Override
  public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
  
      if (holder instanceof ProfileHeaderViewHolder) {
  
      } else if (holder instanceof ProfileViewPagerViewHolder) {
          ((ProfileViewPagerViewHolder) holder).viewPager
                  .setAdapter(new ProfileViewPagerViewHolder.ProfilePagerAdapter(mFragmentManager));
      }
  }
  
  @Override
  public int getItemViewType(int position) {
  
      if (position == 0) {
          return TYPE_HEADER;
      } else {
          return TYPE_PAGER;
      }
  }
  
  @Override
  public int getItemCount() {
      return 2;
  }
  </code></pre>
  
  <p><strong>ProfileHeaderViewHolder.java</strong></p>
  
  <pre><code>public class ProfileHeaderViewHolder extends RecyclerView.ViewHolder {
  
  private CircleImageView profilePic;
  
  private TextView nameText;
  private TextView bioText;
  private TextView urlText;
  
  private TextView postsCountText;
  private TextView followersCountText;
  private TextView followingsCountText;
  
  private TabLayout tabLayout;
  
  public ProfileHeaderViewHolder(View itemView) {
      super(itemView);
  
      profilePic = (CircleImageView) itemView.findViewById(R.id.iv_profile_pic);
      nameText = (TextView) itemView.findViewById(R.id.tv_name);
      urlText = (TextView) itemView.findViewById(R.id.tv_url);
      bioText = (TextView) itemView.findViewById(R.id.tv_bio);
  
      postsCountText = (TextView) itemView.findViewById(R.id.tv_posts);
      followersCountText = (TextView) itemView.findViewById(R.id.tv_followers);
      followingsCountText = (TextView) itemView.findViewById(R.id.tv_followings);
  }
  }
  </code></pre>
  
  <p><strong>ProfileViewPagerViewHolder.java</strong></p>
  
  <pre><code>public class ProfileViewPagerViewHolder extends RecyclerView.ViewHolder {
  
  public TabLayout tabLayout;
  public ViewPager viewPager;
  
  public ProfileViewPagerViewHolder(View itemView) {
      super(itemView);
  
      tabLayout = (TabLayout) itemView.findViewById(R.id.tab_layout);
      viewPager = (ViewPager) itemView.findViewById(R.id.vp_profile);
  
      tabLayout.addTab(tabLayout.newTab().setText("Posts"));
      tabLayout.addTab(tabLayout.newTab().setText("Dares"));
  
      viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
  
      tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
          @Override
          public void onTabSelected(TabLayout.Tab tab) {
              viewPager.setCurrentItem(tab.getPosition());
          }
  
          @Override
          public void onTabUnselected(TabLayout.Tab tab) {
  
          }
  
          @Override
          public void onTabReselected(TabLayout.Tab tab) {
  
          }
      });
  }
  
  public static class ProfilePagerAdapter extends FragmentPagerAdapter {
  
      public ProfilePagerAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public Fragment getItem(int position) {
  
          switch (position) {
  
              case 0:
                  return new ProfilePostsFragment();
  
              case 1:
                  return new ProfileDaresFragment();
  
              default:
                  return null;
          }
      }
  
      @Override
      public int getCount() {
          return 2;
      }
  }
  }
  </code></pre>
  
  <p>I'm not sure if this is a good way to obtain what I'm trying to achieve. I want the user to be able to switch between two options inside the user profile fragment.</p>
  
  <p><strong>fragment_profile.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;android.support.v7.widget.RecyclerView
      android:id="@+id/rv_profile"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>layout_profile_view_pager.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"&gt;
  
  &lt;View
      android:layout_width="match_parent"
      android:layout_height="1dp"
      android:background="@color/colorGreyLight" /&gt;
  
  &lt;android.support.design.widget.TabLayout
      android:id="@+id/tab_layout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@android:color/white"
      app:tabGravity="fill"
      app:tabMode="fixed" /&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/vp_profile"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Most of what I've done so far seems to work and the only problem I'm encountering is that I can see the first item but I cannot scroll down further to see the remaining items in the rv_profile_posts RecyclerView.</p>
  
  <p>Any help would be much appreciated.</p>