AnimateLayoutChanges doesn't work with RecyclerView
<p>I have a screen with a Recyclerview and others Elements inside of LinearLayout. The problem is when I remove a item of the RecyclerView, animateLayoutChanges doesn't work in this case. Does anayone know why this happen??</p>

<p><a href="https://i.stack.imgur.com/WvmHg.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/WvmHg.gif" alt="Demo"></a></p>

<p><strong>XML</strong></p>

<pre><code>&lt;LinearLayout
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="com.example.alvaro.resizetest.MainActivity"&gt;

&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:animateLayoutChanges="true"
    android:orientation="vertical"&gt;

    &lt;android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/&gt;

    &lt;LinearLayout
        android:id="@+id/test1"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/colorAccent"
        android:gravity="center_vertical"&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="LinearLayout"
            android:textColor="#FFFFFF"
            android:textSize="22sp"/&gt;
    &lt;/LinearLayout&gt;


    &lt;LinearLayout
        android:id="@+id/test2"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/colorPrimaryDark"
        android:gravity="center_vertical"&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="LinearLayout"
            android:textColor="#FFFFFF"
            android:textSize="22sp"/&gt;
    &lt;/LinearLayout&gt;


    &lt;LinearLayout
        android:id="@+id/test3"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/colorAccent"
        android:gravity="center_vertical"&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="LinearLayout"
            android:textColor="#FFFFFF"
            android:textSize="22sp"/&gt;
    &lt;/LinearLayout&gt;


    &lt;LinearLayout
        android:id="@+id/test4"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/colorPrimaryDark"
        android:gravity="center_vertical"&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="LinearLayout"
            android:textColor="#FFFFFF"
            android:textSize="22sp"/&gt;
    &lt;/LinearLayout&gt;


&lt;/LinearLayout&gt;
</code></pre>

<p></p>

<p><strong>JAVA</strong></p>

<pre><code>public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerview);

    Adapter adapter = new Adapter();

    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
    recyclerView.setNestedScrollingEnabled(true);

    View.OnClickListener listener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            view.setVisibility(View.GONE);
        }
    };

    findViewById(R.id.test1).setOnClickListener(listener);
    findViewById(R.id.test2).setOnClickListener(listener);
    findViewById(R.id.test3).setOnClickListener(listener);
    findViewById(R.id.test4).setOnClickListener(listener);

}


class Adapter extends RecyclerView.Adapter&lt;Adapter.Holder&gt;{

    int size = 3;

    public Adapter() {
    }

    @Override
    public Holder onCreateViewHolder(ViewGroup parent, int viewType) {

        View view = getLayoutInflater().inflate(R.layout.item, parent, false);

        return new Holder(view);
    }

    @Override
    public void onBindViewHolder(Holder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return size;
    }

    class Holder extends RecyclerView.ViewHolder {

        public Holder(final View itemView) {
            super(itemView);

            itemView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    size --;
                    notifyItemRemoved(getAdapterPosition());
                }
            });

        }
    }
}
</code></pre>