title: Recyclerview height is not changing after removing item
body: <p>I need help. I'm working on a Android app. I use recyclerview.
  My layout looks like after adding item.</p>
  
  <blockquote>
    <p><strong><em>p.s (Ekle: Add / İçindekiler: ingredients / Tarif Başlığı: Recipe Title)</em></strong></p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/8nfoF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8nfoF.png" alt="After adding items"></a>
  When I click "X" button then that item is removing but recyclerview height is not change.</p>
  
  <p><a href="https://i.stack.imgur.com/nJpvH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nJpvH.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/nY0UM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nY0UM.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>How can I handle it? <strong>Thanks in advance</strong></p>
  </blockquote>
  
  <p>adapter:</p>
  
  <pre><code>public class IngredientsAddAdapter extends RecyclerView.Adapter&lt;IngredientsAddAdapter.IngredientsVH&gt; {
  
      List&lt;String&gt; dataList;
      Context context;
      OnItemClickListener clickListener;
  
      public IngredientsAddAdapter(Context context, List&lt;String&gt; dataList) {
          this.context = context;
          this.dataList = dataList;
      }
  
      @Override
      public IngredientsVH onCreateViewHolder(ViewGroup viewGroup, int i) {
          View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.ingredients_add_list_item, viewGroup, false);
          return new IngredientsVH(view);
      }
  
      @Override
      public void onBindViewHolder(IngredientsVH ingredientsVH, int i) {
          ingredientsVH.title.setText(dataList.get(i));
  
      }
  
      @Override
      public int getItemCount() {
          return dataList == null ? 0 : dataList.size();
      }
  
      class IngredientsVH extends RecyclerView.ViewHolder implements View.OnClickListener {
          TextView title;
          ImageButton deleteIng;
  
          public IngredientsVH(View itemView) {
              super(itemView);
              title = (TextView) itemView.findViewById(R.id.ingredientItem);
              deleteIng = (ImageButton) itemView.findViewById(R.id.deleteIng);
              deleteIng.setOnClickListener(this);
          }
  
          @Override
          public void onClick(View v) {
              clickListener.onItemClick(v, getAdapterPosition());
              dataList.remove(getAdapterPosition());
              notifyItemRemoved(getAdapterPosition());
              notifyItemRangeChanged(getAdapterPosition(), dataList.size());
          }
  
      }
  
      public interface OnItemClickListener {
          public void onItemClick(View view, int position);
      }
  
      public void SetOnItemClickListener(final OnItemClickListener itemClickListener) {
          this.clickListener = itemClickListener;
      }
  
  }
  </code></pre>
  
  <p>Activity:</p>
  
  <pre><code>ingList = (RecyclerView) findViewById(R.id.ingList);
  ingList.setNestedScrollingEnabled(false);
  ingList.setLayoutManager(new LinearLayoutManager(recipeAdd.this));
  ingList.setItemAnimator(new DefaultItemAnimator());
  ingList.setHasFixedSize(true);
  if (ingredientsAddAdapter == null) {
      ingredientsAddAdapter = new IngredientsAddAdapter(recipeAdd.this, ingredientsAddArray);
      ingList.setAdapter(ingredientsAddAdapter);
      ingredientsAddAdapter.SetOnItemClickListener(new IngredientsAddAdapter.OnItemClickListener() {
          @Override
          public void onItemClick(View view, int position) {
          }
      });
  }
  </code></pre>
  
  <p>recipe_add.xml (These codes are for testing purposes only. :D )</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:layout_height="match_parent"
      android:background="@color/colorBg"
      android:padding="5dp"&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentTop="true"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true"&gt;
  
  
          &lt;android.support.v7.widget.CardView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true"
              android:layout_marginBottom="10dp"&gt;
  
              &lt;LinearLayout
                  android:orientation="vertical"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
  
                  &lt;EditText
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:ems="10"
                      android:id="@+id/recipeTitle"
                      android:inputType="text"
                      android:hint="Tarif Başlığı"
                      style="@style/Widget.AppCompat.Light.AutoCompleteTextView"
                      android:fontFamily="sans-serif"
                      android:textSize="14sp"
                      android:textStyle="normal|bold"
                      android:layout_margin="5dp"
                      android:background="@drawable/border"
                      android:padding="10dp" /&gt;
  
              &lt;/LinearLayout&gt;
          &lt;/android.support.v7.widget.CardView&gt;
  
          &lt;android.support.v7.widget.CardView
              android:layout_width="match_parent"
              android:layout_height="wrap_content" &gt;
  
              &lt;RelativeLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
  
                  &lt;Button
                      android:text="Ekle"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerVertical="true"
                      android:layout_alignParentRight="true"
                      android:layout_alignParentEnd="true"
                      android:id="@+id/ingAdd"
                      android:onClick="addIng" /&gt;
  
                  &lt;TextView
                      android:text="İçindekiler"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:id="@+id/textView4"
                      android:textStyle="normal|bold"
                      android:textSize="14sp"
                      android:padding="10dp"
                      android:layout_centerVertical="true"
                      android:layout_alignParentLeft="true"
                      android:layout_alignParentStart="true" /&gt;
              &lt;/RelativeLayout&gt;
  
          &lt;/android.support.v7.widget.CardView&gt;
  
          &lt;android.support.v7.widget.CardView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/ingList" /&gt;
          &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>ingredients_add_list_item.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:background="@drawable/border_top"
      android:orientation="horizontal"&gt;
  
      &lt;ImageButton
          android:layout_width="30dp"
          android:layout_height="match_parent"
          android:src="@drawable/crop__ic_cancel"
          android:id="@+id/deleteIng"
          android:background="@android:color/transparent" /&gt;
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:id="@+id/ingredientItem"
          android:text="Hello world"
          android:textSize="16dp"
          android:textColor="@color/colorDark"
          android:textStyle="bold"
          android:padding="8dp" /&gt;
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:id="@+id/isClick"
          android:text="false"
          android:textSize="16dp"
          android:visibility="gone"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>