title: Measure Recyclerview before it appears
body: <p>I am currently experiencing an issue when measuring a recyclerView before it appears. I need the measuredHeight in order to start an "expand" animation.</p>
  
  <p>This was previously done for a gridView  in the code I'm working on and I am trying to migrate it to a RecyclerView with GridLayoutManager</p>
  
  <pre><code>final int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
  final int heightSpec = View.MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK, View.MeasureSpec.AT_MOST);
  mGridView.measure(widthSpec, heightSpec);
  int targetHeight = mGridView.getMeasuredHeight();
  </code></pre>
  
  <p>It was working with the gridView but if I call measure method with same measure specs on the recyclerView, result is always 16777215 which I think might be a max value for something but I cannot say what.</p>
  
  <p>I saw some post explaining that a view can be measured before it is rendered on screen by measuring it with following measure specs : </p>
  
  <pre><code>final int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
  final int heightSpec = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
  </code></pre>
  
  <p>but I get 0 for recyclerView.getMeasuredHeight();.</p>
  
  <p>Is there a way to properly measure the height of the recyclerView before it is rendered on screen ?</p>
  
  <p>Thanks.</p>