RecyclerView recalculate WRAP_CONTENT
<p>With version 23.2 we can now use <code>WRAP_CONTENT</code> for <code>recyclerView</code> height, which is great.  I am doing this, however I want to recalculate the height after an item is added (or removed) to the adapter (thus increasing or decreasing the height).  </p>

<p>My particular <code>RecyclerView</code> is starting with 1 item, and then adding items as the user makes selection. So I need the <code>RecyclerView</code> layout to increase in height, up to a point. Ideally this would happen with a smooth animation when the list increases or decreases.</p>

<p>How can we make it <code>WRAP_CONTENT</code> after it has been laid out?</p>

<p>Tried:</p>

<pre><code>recyclerview.requestLayout();

recyclerview.invalidate();
</code></pre>