title: RecyclerView: Animate item resize
body: <p>I have a <code>RecyclerView</code>. Each of its items of the recycler view can be either expanded or not. There can be only one item expanded at the same time.</p>
  
  <p>In essence, I'm trying to re-create the history list in lolipop dialier.</p>
  
  <p>I have found that <a href="https://stackoverflow.com/a/26479862/1269640">using a LayoutTransition on RecyclerView</a> <a href="http://www.reddit.com/r/androiddev/comments/2ju8vj/recyclerview_keeps_crashing/clfcptv" rel="noreferrer">makes it crash</a>.</p>
  
  <p>But I have not been able to correctly animate the item view change between both states.</p>
  
  <p>I have tried <code>getItemAnimator().setSupportsChangeAnimations(true)</code> in conjunction with <code>notifyItemChanged(getPosition())</code> but there is two problems:</p>
  
  <ul>
  <li>The view is re-created, making the transition quite weird as it fades in above the next item at the same time as the item is moving. The new view that appears is not resizing, it is already at full size.</li>
  <li>As the view is re-created, the old view is fade out while the new is fade in, which makes the view background color flicker.</li>
  </ul>
  
  <p>I have also tried setting a <code>LayoutTransition</code> on the item view for the duration of the animation but the problem with this approach is that the layout of the RecycleView updates immediately and does not follow the animation.</p>
  
  <p>I have created a small demo project of this issue for both tries.
  <a href="https://mega.co.nz/#!xVEEQJTR!DWnPZTJRGohjnRmKQhdtKW_8kSlxh_cJw2q1xmKbgUY" rel="noreferrer">The projects sources are here</a>.</p>
  
  <p>How can I create a smooth transition on item layout change ?</p>