title: Resize Recyclerview height after Bottomsheet open cause gaps between items
body: <p>I am resizing a RecyclerView height after the user opens or closes a BottomSheet so the RecyclerView's height will be between a ToolBar and my BottomSheet.
  The problem is when the height gets changed, while scrolling up or down it causes a big gap between the items - the gap is actually an item that got 0 width and bigger height then it should be and that's why it looks like a gap.</p>
  
  <p>This is the main layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".RegisterActivity"&gt;
  
      &lt;!-- includes the RecyclerView --&gt;
      &lt;include layout="@layout/activity_register_sheet_content" /&gt;
  
      &lt;!-- includes the bottom sheet --&gt;
      &lt;include layout="@layout/register_bottom_sheet" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>and java:</p>
  
  <pre><code>    bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
          @Override
          public void onStateChanged(@NonNull View bottomSheet, int newState) {
              ViewGroup.LayoutParams params = registerRecyclerView.getLayoutParams();
  
              if (newState == STATE_COLLAPSED) {
                  params.height = originalRecyclerViewHeight;
                  registerRecyclerView.setLayoutParams(params);
  
              } else if (newState == STATE_EXPANDED) {
                  params.height = realRecyclerHeight - bottomSheet.getMeasuredHeightAndState();
                  registerRecyclerView.setLayoutParams(params);
              }
          }
  
          @Override
          public void onSlide(@NonNull View bottomSheet, float slideOffset) {
          }
      });
  </code></pre>
  
  <p>I'm using this version of AppCompat:</p>
  
  <pre><code>implementation 'com.android.support:appcompat-v7:27.1.1'
  </code></pre>
  
  <p>Thanks for helping!</p>